diff --git a/.gitattributes b/.gitattributes index bedf18fc7482c55b3934c9f8f746762a77803d9b..828064a2fa1d994047c9ef6b8556aa2c3c1d2030 100644 --- a/.gitattributes +++ b/.gitattributes @@ -40,3 +40,6 @@ evidence/final/harbor_validation/packages/np-b586fbb5b010/environment/panel.png evidence/final/harbor_validation/packages/np-da0f4bf21257/environment/panel.png filter=lfs diff=lfs merge=lfs -text evidence/final/instruments/tasks/np-835d219fd25e/image.png filter=lfs diff=lfs merge=lfs -text evidence/final/instruments/tasks/np-daf8248be27d/image.png filter=lfs diff=lfs merge=lfs -text +needlepoint/fonts/DejaVuSans-Bold.ttf filter=lfs diff=lfs merge=lfs -text +needlepoint/fonts/DejaVuSans.ttf filter=lfs diff=lfs merge=lfs -text +needlepoint/fonts/DejaVuSansMono.ttf filter=lfs diff=lfs merge=lfs -text diff --git a/evidence/final/wiring/tasks/w-3cce62d17aa3/task.json b/evidence/final/wiring/tasks/w-3cce62d17aa3/task.json new file mode 100644 index 0000000000000000000000000000000000000000..5c035923ee657f917df0ce4ed21903ac219ca079 --- /dev/null +++ b/evidence/final/wiring/tasks/w-3cce62d17aa3/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-3cce62d17aa3", + "image": "image.png", + "question": "Follow the wire that starts at terminal L5. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-3db1556712ac/answer.json b/evidence/final/wiring/tasks/w-3db1556712ac/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-3db1556712ac/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-3db1556712ac/certificate.json b/evidence/final/wiring/tasks/w-3db1556712ac/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..d7ad0c57d1faf30222f8c86c30e5f2ce889934b2 --- /dev/null +++ b/evidence/final/wiring/tasks/w-3db1556712ac/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-3db1556712ac", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000015 + }, + "spec_hash": "sha256:06a36b5008a388c17b36435c4b496f5cc010a8cea5f9cdb8c6531e3b457d2e13", + "image_sha256": "5a75fb27304a611b00e4dfdde2594785af0a6c5577f6abd9026a59e07b4f9d04", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 1, + "crossings_on_query_wire": 1 + }, + "targets": [], + "spec": { + "seed": 20261208000015, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 1, + 0, + 3, + 2 + ], + [ + 1, + 0, + 2, + 3 + ], + [ + 2, + 0, + 1, + 3 + ], + [ + 3, + 0, + 1, + 2 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-3db1556712ac/task.json b/evidence/final/wiring/tasks/w-3db1556712ac/task.json new file mode 100644 index 0000000000000000000000000000000000000000..1cd722c8fdcac9ae0410516da0d6dc717728db46 --- /dev/null +++ b/evidence/final/wiring/tasks/w-3db1556712ac/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-3db1556712ac", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-3ec2dd2a982e/answer.json b/evidence/final/wiring/tasks/w-3ec2dd2a982e/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..8b7db7237e6cbef20519d43d0979ad4e6a0c6284 --- /dev/null +++ b/evidence/final/wiring/tasks/w-3ec2dd2a982e/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R7", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-3ec2dd2a982e/certificate.json b/evidence/final/wiring/tasks/w-3ec2dd2a982e/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..258e39440751e99074bd98fd44b54bc67f3311b8 --- /dev/null +++ b/evidence/final/wiring/tasks/w-3ec2dd2a982e/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-3ec2dd2a982e", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L10 -> R7" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000064 + }, + "spec_hash": "sha256:c4c18a2fd63a42592d74e9d67dece1c659e9988ac67bbfad6a031c3a65908f87", + "image_sha256": "f6fa63a42524e37f115a806a277b504c62512a36d283c43ee2c7303071820f62", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R7 vs R7" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 27, + "crossings_on_query_wire": 3 + }, + "targets": [], + "spec": { + "seed": 20261208000064, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5, + 7, + 6, + 8, + 9 + ], + [ + 2, + 0, + 3, + 1, + 4, + 5, + 8, + 6, + 7, + 9 + ], + [ + 3, + 1, + 2, + 0, + 4, + 6, + 7, + 5, + 8, + 9 + ], + [ + 2, + 0, + 3, + 1, + 5, + 7, + 6, + 4, + 9, + 8 + ], + [ + 3, + 1, + 2, + 0, + 6, + 8, + 5, + 4, + 9, + 7 + ], + [ + 3, + 2, + 1, + 0, + 6, + 7, + 4, + 5, + 9, + 8 + ], + [ + 2, + 3, + 0, + 1, + 5, + 8, + 4, + 6, + 9, + 7 + ], + [ + 3, + 2, + 1, + 0, + 4, + 8, + 5, + 7, + 9, + 6 + ], + [ + 3, + 2, + 0, + 1, + 5, + 7, + 4, + 8, + 9, + 6 + ], + [ + 4, + 2, + 1, + 0, + 6, + 7, + 3, + 9, + 8, + 5 + ], + [ + 4, + 3, + 0, + 1, + 5, + 8, + 2, + 9, + 7, + 6 + ], + [ + 3, + 4, + 1, + 0, + 5, + 8, + 2, + 9, + 7, + 6 + ] + ], + "query": 9, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-3ec2dd2a982e/task.json b/evidence/final/wiring/tasks/w-3ec2dd2a982e/task.json new file mode 100644 index 0000000000000000000000000000000000000000..6aee64bd8653f14531a23b7df492fe8a49c4639c --- /dev/null +++ b/evidence/final/wiring/tasks/w-3ec2dd2a982e/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-3ec2dd2a982e", + "image": "image.png", + "question": "Follow the wire that starts at terminal L10. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-421ed1e04999/answer.json b/evidence/final/wiring/tasks/w-421ed1e04999/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..6768ff6c53a4e672438d926736038beb3fa240ca --- /dev/null +++ b/evidence/final/wiring/tasks/w-421ed1e04999/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R3", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-421ed1e04999/certificate.json b/evidence/final/wiring/tasks/w-421ed1e04999/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..5cb8b61731cb89155c50319645f31262fd0cb1e8 --- /dev/null +++ b/evidence/final/wiring/tasks/w-421ed1e04999/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-421ed1e04999", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R3" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000008 + }, + "spec_hash": "sha256:85cf4462827438683ebab88f84b1c9e9e84988d6c500b4eefcd80e5369619744", + "image_sha256": "d073456afb726c724337aa13c24b323fdbb81b91664b09dee80f58e7ba647216", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 180.0 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R3 vs R3" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 0, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000008, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 1, + 0, + 3, + 2 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 1, + 0, + 2, + 3 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-421ed1e04999/task.json b/evidence/final/wiring/tasks/w-421ed1e04999/task.json new file mode 100644 index 0000000000000000000000000000000000000000..72b086485acaa428df05143085fbb0642ef35a7b --- /dev/null +++ b/evidence/final/wiring/tasks/w-421ed1e04999/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-421ed1e04999", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-47d8093f7bb4/answer.json b/evidence/final/wiring/tasks/w-47d8093f7bb4/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..269a7ea426ba2c5c3f50e8292d87378c1f7a5888 --- /dev/null +++ b/evidence/final/wiring/tasks/w-47d8093f7bb4/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R5", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-47d8093f7bb4/certificate.json b/evidence/final/wiring/tasks/w-47d8093f7bb4/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..429eac7816b2969af8b7e61d37fd6d1e31726b65 --- /dev/null +++ b/evidence/final/wiring/tasks/w-47d8093f7bb4/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-47d8093f7bb4", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R5" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000047 + }, + "spec_hash": "sha256:05efdfc6261e04a4264fe43e482b34ee6e85e018e47473bd0b0df2eab4523f1c", + "image_sha256": "243afc0f6df04d2e9a5b6d0e8625aad5fde450534b850720f6408b0f9b3fc361", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R5 vs R5" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 9, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000047, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 7, + 6 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 0, + 2, + 1, + 4, + 3, + 5, + 7, + 6 + ], + [ + 1, + 3, + 0, + 5, + 2, + 4, + 6, + 7 + ], + [ + 0, + 2, + 1, + 4, + 3, + 5, + 6, + 7 + ], + [ + 1, + 3, + 0, + 4, + 2, + 6, + 5, + 7 + ], + [ + 0, + 2, + 1, + 5, + 3, + 6, + 4, + 7 + ], + [ + 1, + 3, + 0, + 4, + 2, + 6, + 5, + 7 + ], + [ + 0, + 2, + 1, + 4, + 3, + 5, + 6, + 7 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-47d8093f7bb4/task.json b/evidence/final/wiring/tasks/w-47d8093f7bb4/task.json new file mode 100644 index 0000000000000000000000000000000000000000..3734a6b2fd703227831a9bd7925656b2be00f7e6 --- /dev/null +++ b/evidence/final/wiring/tasks/w-47d8093f7bb4/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-47d8093f7bb4", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-48ad931b68f1/answer.json b/evidence/final/wiring/tasks/w-48ad931b68f1/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-48ad931b68f1/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-48ad931b68f1/certificate.json b/evidence/final/wiring/tasks/w-48ad931b68f1/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..29e6df98ee23376c3e7818d5850e40442a2f2b77 --- /dev/null +++ b/evidence/final/wiring/tasks/w-48ad931b68f1/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-48ad931b68f1", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000010 + }, + "spec_hash": "sha256:633c738526c1026c3bf82a48836ec8294d944c8fced34d78ac4e984431f7364e", + "image_sha256": "76889efd236839add20ea8757756934262d6830261a6fa9ca5673a171d80acec", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 2, + "crossings_on_query_wire": 1 + }, + "targets": [], + "spec": { + "seed": 20261208000010, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 2, + 1, + 3 + ], + [ + 1, + 3, + 0, + 2 + ], + [ + 2, + 3, + 0, + 1 + ], + [ + 3, + 2, + 1, + 0 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-48ad931b68f1/task.json b/evidence/final/wiring/tasks/w-48ad931b68f1/task.json new file mode 100644 index 0000000000000000000000000000000000000000..664f1bf59cd378549829ff61376e3c5a21c87e81 --- /dev/null +++ b/evidence/final/wiring/tasks/w-48ad931b68f1/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-48ad931b68f1", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4c2f72fe823f/answer.json b/evidence/final/wiring/tasks/w-4c2f72fe823f/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-4c2f72fe823f/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4c2f72fe823f/certificate.json b/evidence/final/wiring/tasks/w-4c2f72fe823f/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..31445001776d749ab1b8c883545c0016aceaa9f5 --- /dev/null +++ b/evidence/final/wiring/tasks/w-4c2f72fe823f/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-4c2f72fe823f", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L2 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000011 + }, + "spec_hash": "sha256:a41ceb4e1afe0503624dce9bb14190769cac9a510fae815fd0d98dd26c163c09", + "image_sha256": "c6a8b2d3286200149dd140b1659ad3441f85c4bd45f821291f0acb1821d1a332", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 180.0 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 0, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000011, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 1, + 0, + 3, + 2 + ], + [ + 0, + 1, + 2, + 3 + ], + [ + 1, + 0, + 2, + 3 + ] + ], + "query": 1, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4c2f72fe823f/task.json b/evidence/final/wiring/tasks/w-4c2f72fe823f/task.json new file mode 100644 index 0000000000000000000000000000000000000000..31a06c40c5e42622c51d011f40307a28ef646596 --- /dev/null +++ b/evidence/final/wiring/tasks/w-4c2f72fe823f/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-4c2f72fe823f", + "image": "image.png", + "question": "Follow the wire that starts at terminal L2. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4ee08fc177f9/answer.json b/evidence/final/wiring/tasks/w-4ee08fc177f9/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-4ee08fc177f9/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4ee08fc177f9/certificate.json b/evidence/final/wiring/tasks/w-4ee08fc177f9/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..e22a24c063d5264b97e9d9778c2d9f52c7ce9669 --- /dev/null +++ b/evidence/final/wiring/tasks/w-4ee08fc177f9/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-4ee08fc177f9", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L2 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000025 + }, + "spec_hash": "sha256:d53e357ef476bf1ee963aad03241fa4308fe5dff9c40bc2f1a4a28aedfd0c413", + "image_sha256": "8ad34149112ff5897ce52605a29938671851d9072e4c6ddb5de973adfdaa5759", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 5, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000025, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5 + ], + [ + 2, + 0, + 1, + 3, + 4, + 5 + ] + ], + "query": 1, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4ee08fc177f9/image.png b/evidence/final/wiring/tasks/w-4ee08fc177f9/image.png new file mode 100644 index 0000000000000000000000000000000000000000..a6b3d31e9498b233b4ba60bfe3f82ace67fa6799 Binary files /dev/null and b/evidence/final/wiring/tasks/w-4ee08fc177f9/image.png differ diff --git a/evidence/final/wiring/tasks/w-4ee08fc177f9/task.json b/evidence/final/wiring/tasks/w-4ee08fc177f9/task.json new file mode 100644 index 0000000000000000000000000000000000000000..0e95767afab8b1a0b8e2e4a5e99b701f9b0e1bfd --- /dev/null +++ b/evidence/final/wiring/tasks/w-4ee08fc177f9/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-4ee08fc177f9", + "image": "image.png", + "question": "Follow the wire that starts at terminal L2. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4f7b9b6a4861/answer.json b/evidence/final/wiring/tasks/w-4f7b9b6a4861/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..da2884c83250e57d3e92be71061db586007d0bd4 --- /dev/null +++ b/evidence/final/wiring/tasks/w-4f7b9b6a4861/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R10", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4f7b9b6a4861/certificate.json b/evidence/final/wiring/tasks/w-4f7b9b6a4861/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..ae4a71ab83a80248f10069bc38f02a4d62387b2d --- /dev/null +++ b/evidence/final/wiring/tasks/w-4f7b9b6a4861/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-4f7b9b6a4861", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L8 -> R10" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000061 + }, + "spec_hash": "sha256:fd4bdc43f460f75b18ef46ee6b788ca0fa56798ecbc94bc6cf9f5d48561c70bc", + "image_sha256": "8c84d497d12534566bfada408b8c9f5df45381a11ad2fc8fbb7589bea140d59a", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R10 vs R10" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 26, + "crossings_on_query_wire": 2 + }, + "targets": [], + "spec": { + "seed": 20261208000061, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 1, + 0, + 2, + 3, + 5, + 4, + 7, + 6, + 9, + 8 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5, + 8, + 6, + 9, + 7 + ], + [ + 1, + 0, + 2, + 3, + 5, + 4, + 9, + 7, + 8, + 6 + ], + [ + 0, + 1, + 2, + 3, + 5, + 4, + 9, + 8, + 7, + 6 + ], + [ + 1, + 0, + 3, + 2, + 6, + 4, + 8, + 9, + 7, + 5 + ], + [ + 0, + 1, + 4, + 2, + 5, + 3, + 7, + 9, + 8, + 6 + ], + [ + 0, + 2, + 3, + 1, + 6, + 4, + 8, + 9, + 7, + 5 + ], + [ + 1, + 3, + 2, + 0, + 7, + 4, + 9, + 8, + 6, + 5 + ], + [ + 2, + 3, + 1, + 0, + 6, + 5, + 8, + 9, + 7, + 4 + ], + [ + 2, + 4, + 0, + 1, + 5, + 6, + 8, + 9, + 7, + 3 + ], + [ + 3, + 4, + 1, + 0, + 5, + 6, + 7, + 9, + 8, + 2 + ], + [ + 2, + 5, + 0, + 1, + 4, + 6, + 8, + 9, + 7, + 3 + ] + ], + "query": 7, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-4f7b9b6a4861/task.json b/evidence/final/wiring/tasks/w-4f7b9b6a4861/task.json new file mode 100644 index 0000000000000000000000000000000000000000..1e46c3f3c39d88aa0756de3d16586dfb4711c2e0 --- /dev/null +++ b/evidence/final/wiring/tasks/w-4f7b9b6a4861/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-4f7b9b6a4861", + "image": "image.png", + "question": "Follow the wire that starts at terminal L8. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-58e3ef799103/answer.json b/evidence/final/wiring/tasks/w-58e3ef799103/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..8b7db7237e6cbef20519d43d0979ad4e6a0c6284 --- /dev/null +++ b/evidence/final/wiring/tasks/w-58e3ef799103/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R7", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-58e3ef799103/certificate.json b/evidence/final/wiring/tasks/w-58e3ef799103/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..d2b6f6b135a795ebb48a03721f9bc98f2bbcd139 --- /dev/null +++ b/evidence/final/wiring/tasks/w-58e3ef799103/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-58e3ef799103", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L6 -> R7" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000072 + }, + "spec_hash": "sha256:35012323b4b00a67cbf1be6a42af2c9914fd6d591ed3227883df63e559edc62a", + "image_sha256": "a4e5c4d61d49389129e0138415c64c8918a6ac436f6e05e1bf75c1f6fe28b227", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R7 vs R7" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 23, + "crossings_on_query_wire": 9 + }, + "targets": [], + "spec": { + "seed": 20261208000072, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 2, + 1, + 3, + 4, + 6, + 5, + 7, + 9, + 8 + ], + [ + 1, + 3, + 0, + 2, + 5, + 6, + 4, + 8, + 9, + 7 + ], + [ + 2, + 3, + 0, + 1, + 5, + 7, + 4, + 9, + 8, + 6 + ], + [ + 3, + 2, + 0, + 1, + 4, + 6, + 5, + 9, + 8, + 7 + ], + [ + 4, + 2, + 0, + 1, + 3, + 6, + 5, + 8, + 9, + 7 + ], + [ + 4, + 3, + 1, + 0, + 2, + 7, + 5, + 9, + 8, + 6 + ], + [ + 3, + 4, + 0, + 1, + 2, + 6, + 5, + 9, + 8, + 7 + ], + [ + 4, + 3, + 0, + 1, + 2, + 5, + 6, + 9, + 7, + 8 + ], + [ + 4, + 3, + 0, + 2, + 1, + 6, + 5, + 9, + 7, + 8 + ], + [ + 5, + 3, + 1, + 2, + 0, + 6, + 4, + 9, + 8, + 7 + ], + [ + 4, + 2, + 0, + 3, + 1, + 7, + 5, + 9, + 8, + 6 + ], + [ + 5, + 3, + 1, + 2, + 0, + 6, + 4, + 8, + 9, + 7 + ] + ], + "query": 5, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-58e3ef799103/task.json b/evidence/final/wiring/tasks/w-58e3ef799103/task.json new file mode 100644 index 0000000000000000000000000000000000000000..5b4f8aff383eb14d02d9919e1ac8dfc6b14be157 --- /dev/null +++ b/evidence/final/wiring/tasks/w-58e3ef799103/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-58e3ef799103", + "image": "image.png", + "question": "Follow the wire that starts at terminal L6. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5ad09ab55111/answer.json b/evidence/final/wiring/tasks/w-5ad09ab55111/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-5ad09ab55111/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5ad09ab55111/certificate.json b/evidence/final/wiring/tasks/w-5ad09ab55111/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..ed9738368bfc8c3a32583753614e457a11c6f800 --- /dev/null +++ b/evidence/final/wiring/tasks/w-5ad09ab55111/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-5ad09ab55111", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000022 + }, + "spec_hash": "sha256:1a6aa9f1772927deab995f63e7073d53c86b8140ced496241b2be6449f6f9944", + "image_sha256": "58025c6d421a5e48bf2c6cd896cfd9a750814a86617ae408d3bfb4e4e753900a", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 9, + "crossings_on_query_wire": 3 + }, + "targets": [], + "spec": { + "seed": 20261208000022, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4 + ], + [ + 1, + 0, + 4, + 2, + 5, + 3 + ], + [ + 0, + 1, + 4, + 3, + 5, + 2 + ], + [ + 1, + 0, + 5, + 2, + 4, + 3 + ], + [ + 0, + 1, + 5, + 2, + 3, + 4 + ], + [ + 0, + 2, + 5, + 1, + 3, + 4 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5ad09ab55111/task.json b/evidence/final/wiring/tasks/w-5ad09ab55111/task.json new file mode 100644 index 0000000000000000000000000000000000000000..2ab23c30faa5fdfa3ef936024a00e403c2136b35 --- /dev/null +++ b/evidence/final/wiring/tasks/w-5ad09ab55111/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-5ad09ab55111", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5bec6a429ffd/answer.json b/evidence/final/wiring/tasks/w-5bec6a429ffd/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-5bec6a429ffd/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5bec6a429ffd/certificate.json b/evidence/final/wiring/tasks/w-5bec6a429ffd/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..dcceed3113e7f6b2d1d3e14b362938482b64d1e2 --- /dev/null +++ b/evidence/final/wiring/tasks/w-5bec6a429ffd/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-5bec6a429ffd", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000012 + }, + "spec_hash": "sha256:adbd30b5dcca3e46a2bae1ae57cc7c6682824ec655d5785366a86fedf9edeffd", + "image_sha256": "e1f2d135271b71e41b51048300cdde1ac48dc2233a4fe1813dbb1fd4f8049683", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 180.0 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 0, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000012, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 1, + 0, + 3, + 2 + ], + [ + 0, + 1, + 2, + 3 + ], + [ + 1, + 0, + 2, + 3 + ], + [ + 1, + 0, + 3, + 2 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5bec6a429ffd/task.json b/evidence/final/wiring/tasks/w-5bec6a429ffd/task.json new file mode 100644 index 0000000000000000000000000000000000000000..2e8b976b766e45a70a3b84dc11f81898b0079a23 --- /dev/null +++ b/evidence/final/wiring/tasks/w-5bec6a429ffd/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-5bec6a429ffd", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5cbec04daec2/answer.json b/evidence/final/wiring/tasks/w-5cbec04daec2/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..e98a68233c3cf25d44dc02c1d9d172d9b8f4c4ba --- /dev/null +++ b/evidence/final/wiring/tasks/w-5cbec04daec2/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R9", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5cbec04daec2/certificate.json b/evidence/final/wiring/tasks/w-5cbec04daec2/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..836992cba3af4205970106540c75b1d479fea4df --- /dev/null +++ b/evidence/final/wiring/tasks/w-5cbec04daec2/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-5cbec04daec2", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L12 -> R9" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000081 + }, + "spec_hash": "sha256:fb1c9f4a963e155e54a6a5d18fe20f78c3d96231f99b91bc990d05509a730cc9", + "image_sha256": "2a45af654b7d91f1c4aba0eae222e4faa31be4ec408280eb1cb62badb7dcb54d", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R9 vs R9" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 23, + "crossings_on_query_wire": 1 + }, + "targets": [], + "spec": { + "seed": 20261208000081, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 3, + 2, + 4, + 6, + 5, + 8, + 7, + 10, + 9, + 11 + ], + [ + 0, + 1, + 4, + 2, + 3, + 5, + 6, + 8, + 7, + 9, + 10, + 11 + ], + [ + 1, + 0, + 4, + 3, + 2, + 6, + 5, + 8, + 7, + 10, + 9, + 11 + ], + [ + 2, + 0, + 3, + 4, + 1, + 5, + 6, + 9, + 7, + 11, + 8, + 10 + ], + [ + 3, + 1, + 2, + 5, + 0, + 4, + 7, + 8, + 6, + 10, + 9, + 11 + ], + [ + 2, + 0, + 3, + 4, + 1, + 5, + 6, + 8, + 7, + 10, + 9, + 11 + ], + [ + 1, + 0, + 4, + 3, + 2, + 6, + 5, + 9, + 7, + 10, + 8, + 11 + ], + [ + 0, + 1, + 5, + 2, + 3, + 7, + 4, + 10, + 6, + 9, + 8, + 11 + ], + [ + 1, + 0, + 6, + 3, + 2, + 8, + 4, + 11, + 5, + 9, + 7, + 10 + ], + [ + 1, + 0, + 7, + 2, + 3, + 8, + 5, + 11, + 4, + 10, + 6, + 9 + ], + [ + 0, + 1, + 8, + 3, + 2, + 7, + 6, + 11, + 4, + 10, + 5, + 9 + ], + [ + 1, + 0, + 9, + 2, + 3, + 6, + 7, + 10, + 5, + 11, + 4, + 8 + ], + [ + 0, + 1, + 8, + 2, + 3, + 7, + 6, + 11, + 4, + 10, + 5, + 9 + ], + [ + 1, + 0, + 8, + 2, + 4, + 6, + 7, + 10, + 3, + 11, + 5, + 9 + ], + [ + 1, + 0, + 9, + 2, + 3, + 7, + 6, + 10, + 4, + 11, + 5, + 8 + ] + ], + "query": 11, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-5cbec04daec2/image.png b/evidence/final/wiring/tasks/w-5cbec04daec2/image.png new file mode 100644 index 0000000000000000000000000000000000000000..70bb5357cd2306252dd6743efa1f5c4c888420ef Binary files /dev/null and b/evidence/final/wiring/tasks/w-5cbec04daec2/image.png differ diff --git a/evidence/final/wiring/tasks/w-5cbec04daec2/task.json b/evidence/final/wiring/tasks/w-5cbec04daec2/task.json new file mode 100644 index 0000000000000000000000000000000000000000..c9a65d034f4cdf633756119bfcd70616b8ed45c8 --- /dev/null +++ b/evidence/final/wiring/tasks/w-5cbec04daec2/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-5cbec04daec2", + "image": "image.png", + "question": "Follow the wire that starts at terminal L12. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-60b61603237c/answer.json b/evidence/final/wiring/tasks/w-60b61603237c/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..6768ff6c53a4e672438d926736038beb3fa240ca --- /dev/null +++ b/evidence/final/wiring/tasks/w-60b61603237c/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R3", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-60b61603237c/certificate.json b/evidence/final/wiring/tasks/w-60b61603237c/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..52cf9087143e72dc19f9065dacdcad16d53010c1 --- /dev/null +++ b/evidence/final/wiring/tasks/w-60b61603237c/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-60b61603237c", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R3" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000031 + }, + "spec_hash": "sha256:a5e753313f67ea2b7d84a5d98d6d4514dabcbcefc2db01069ba9a28a57dd3ed5", + "image_sha256": "6989c8bfc05bfc3ec00435d8907263eb05186abd0ff810d2003a3c388995e8d6", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R3 vs R3" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 9, + "crossings_on_query_wire": 3 + }, + "targets": [], + "spec": { + "seed": 20261208000031, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5 + ], + [ + 1, + 0, + 3, + 5, + 2, + 4 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4 + ], + [ + 2, + 0, + 3, + 1, + 5, + 4 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-60b61603237c/task.json b/evidence/final/wiring/tasks/w-60b61603237c/task.json new file mode 100644 index 0000000000000000000000000000000000000000..ec025193b20fb86b613d1ba15e0419e94eb993f9 --- /dev/null +++ b/evidence/final/wiring/tasks/w-60b61603237c/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-60b61603237c", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6329a0a6bc86/answer.json b/evidence/final/wiring/tasks/w-6329a0a6bc86/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..da2884c83250e57d3e92be71061db586007d0bd4 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6329a0a6bc86/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R10", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6329a0a6bc86/certificate.json b/evidence/final/wiring/tasks/w-6329a0a6bc86/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..4969f3150645c98146766e466b2d14d25ff198af --- /dev/null +++ b/evidence/final/wiring/tasks/w-6329a0a6bc86/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-6329a0a6bc86", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L7 -> R10" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000067 + }, + "spec_hash": "sha256:4fcc41a6b8358cc60fc932598e90ae7dde0ad229f8826b8be64ad09f4b321ec7", + "image_sha256": "aecf14afe61965939ca2307fb4dc01b916a7aa75fd8ae6edd428a6e8e95dd163", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R10 vs R10" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 22, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000067, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 2, + 1, + 4, + 3, + 5, + 7, + 6, + 9, + 8 + ], + [ + 1, + 3, + 0, + 4, + 2, + 6, + 7, + 5, + 8, + 9 + ], + [ + 1, + 4, + 0, + 3, + 2, + 7, + 6, + 5, + 9, + 8 + ], + [ + 0, + 5, + 1, + 2, + 3, + 6, + 7, + 4, + 8, + 9 + ], + [ + 0, + 5, + 1, + 2, + 3, + 7, + 6, + 4, + 9, + 8 + ], + [ + 1, + 4, + 0, + 3, + 2, + 8, + 6, + 5, + 9, + 7 + ], + [ + 1, + 5, + 0, + 2, + 3, + 9, + 7, + 4, + 8, + 6 + ], + [ + 2, + 6, + 0, + 1, + 3, + 8, + 7, + 4, + 9, + 5 + ], + [ + 2, + 5, + 1, + 0, + 3, + 7, + 8, + 4, + 9, + 6 + ], + [ + 1, + 6, + 2, + 0, + 4, + 7, + 8, + 3, + 9, + 5 + ], + [ + 1, + 5, + 2, + 0, + 3, + 7, + 9, + 4, + 8, + 6 + ], + [ + 0, + 4, + 2, + 1, + 3, + 8, + 9, + 5, + 7, + 6 + ] + ], + "query": 6, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6329a0a6bc86/image.png b/evidence/final/wiring/tasks/w-6329a0a6bc86/image.png new file mode 100644 index 0000000000000000000000000000000000000000..4cb215c2749cc9c9cfa21dd1f5f4a267d361454e Binary files /dev/null and b/evidence/final/wiring/tasks/w-6329a0a6bc86/image.png differ diff --git a/evidence/final/wiring/tasks/w-6329a0a6bc86/task.json b/evidence/final/wiring/tasks/w-6329a0a6bc86/task.json new file mode 100644 index 0000000000000000000000000000000000000000..fdbfd1105c7fe30a2f69855e42130bb0ffad4332 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6329a0a6bc86/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-6329a0a6bc86", + "image": "image.png", + "question": "Follow the wire that starts at terminal L7. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-63af9b819855/answer.json b/evidence/final/wiring/tasks/w-63af9b819855/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-63af9b819855/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-63af9b819855/certificate.json b/evidence/final/wiring/tasks/w-63af9b819855/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..89f9ab33d8f533819402500c8c4d9144cf806abe --- /dev/null +++ b/evidence/final/wiring/tasks/w-63af9b819855/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-63af9b819855", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000013 + }, + "spec_hash": "sha256:e51e8f74050fa858e1f72387bc167cc5daa96b30529d07196e64b54f5579f05d", + "image_sha256": "b5dcece592904cac5e9c5644e69491d72d62c423b92c7f34b591d4db5f0805fe", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 1, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000013, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 2, + 1, + 3 + ], + [ + 1, + 3, + 0, + 2 + ], + [ + 0, + 2, + 1, + 3 + ], + [ + 1, + 3, + 0, + 2 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-63af9b819855/task.json b/evidence/final/wiring/tasks/w-63af9b819855/task.json new file mode 100644 index 0000000000000000000000000000000000000000..5d8737ff0607e3c363afe683a757193525c22fa2 --- /dev/null +++ b/evidence/final/wiring/tasks/w-63af9b819855/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-63af9b819855", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6596788941cb/answer.json b/evidence/final/wiring/tasks/w-6596788941cb/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..269a7ea426ba2c5c3f50e8292d87378c1f7a5888 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6596788941cb/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R5", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6596788941cb/certificate.json b/evidence/final/wiring/tasks/w-6596788941cb/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..10f154e3f9f70425cd9ccb2cfe3e396f46383538 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6596788941cb/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-6596788941cb", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R5" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000070 + }, + "spec_hash": "sha256:9ffe090079b0909e5d9caa71c5133fcd8541e647726256d9d7187ce9bcac1ac8", + "image_sha256": "f1e56478be84bca050dbb412eb6abdc7f06ea8269f739d45fce305aac294fdb0", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R5 vs R5" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 24, + "crossings_on_query_wire": 4 + }, + "targets": [], + "spec": { + "seed": 20261208000070, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 1, + 2, + 4, + 3, + 5, + 7, + 6, + 9, + 8 + ], + [ + 1, + 0, + 3, + 4, + 2, + 6, + 7, + 5, + 8, + 9 + ], + [ + 1, + 0, + 2, + 5, + 3, + 6, + 8, + 4, + 7, + 9 + ], + [ + 0, + 1, + 3, + 4, + 2, + 6, + 7, + 5, + 8, + 9 + ], + [ + 0, + 1, + 4, + 3, + 2, + 7, + 6, + 5, + 9, + 8 + ], + [ + 1, + 0, + 5, + 2, + 3, + 8, + 6, + 4, + 9, + 7 + ], + [ + 0, + 1, + 4, + 2, + 3, + 9, + 7, + 5, + 8, + 6 + ], + [ + 1, + 0, + 5, + 3, + 2, + 9, + 8, + 4, + 7, + 6 + ], + [ + 0, + 1, + 4, + 2, + 3, + 9, + 8, + 5, + 6, + 7 + ], + [ + 1, + 0, + 4, + 3, + 2, + 9, + 7, + 6, + 5, + 8 + ], + [ + 2, + 0, + 5, + 3, + 1, + 8, + 6, + 7, + 4, + 9 + ], + [ + 2, + 1, + 6, + 4, + 0, + 8, + 5, + 7, + 3, + 9 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6596788941cb/image.png b/evidence/final/wiring/tasks/w-6596788941cb/image.png new file mode 100644 index 0000000000000000000000000000000000000000..43383468c5d4110fbfccac4d95822bacb50cfd46 Binary files /dev/null and b/evidence/final/wiring/tasks/w-6596788941cb/image.png differ diff --git a/evidence/final/wiring/tasks/w-6596788941cb/task.json b/evidence/final/wiring/tasks/w-6596788941cb/task.json new file mode 100644 index 0000000000000000000000000000000000000000..5df5ab08fc7f3e26297add2b1487597c9fe59a1a --- /dev/null +++ b/evidence/final/wiring/tasks/w-6596788941cb/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-6596788941cb", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-678b494cbeb7/answer.json b/evidence/final/wiring/tasks/w-678b494cbeb7/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..6768ff6c53a4e672438d926736038beb3fa240ca --- /dev/null +++ b/evidence/final/wiring/tasks/w-678b494cbeb7/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R3", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-678b494cbeb7/certificate.json b/evidence/final/wiring/tasks/w-678b494cbeb7/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..cffc8c1764ef79ff10763f53c01aa156d92762d0 --- /dev/null +++ b/evidence/final/wiring/tasks/w-678b494cbeb7/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-678b494cbeb7", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L5 -> R3" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000032 + }, + "spec_hash": "sha256:8bb22d5c9c21d8842a4707b94549618c1c14f8f672e6e85ea4a20f26a7ac5778", + "image_sha256": "3bb394746c73ab4730dd9abe4dc06944a4734df545a78ce6cf6fc9e637b516cd", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R3 vs R3" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 12, + "crossings_on_query_wire": 3 + }, + "targets": [], + "spec": { + "seed": 20261208000032, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5 + ], + [ + 1, + 0, + 2, + 3, + 5, + 4 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5 + ], + [ + 2, + 0, + 1, + 4, + 3, + 5 + ], + [ + 3, + 1, + 0, + 5, + 2, + 4 + ] + ], + "query": 4, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-678b494cbeb7/task.json b/evidence/final/wiring/tasks/w-678b494cbeb7/task.json new file mode 100644 index 0000000000000000000000000000000000000000..b177751c7b4378af1ce5d8ccce4e839208d732f7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-678b494cbeb7/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-678b494cbeb7", + "image": "image.png", + "question": "Follow the wire that starts at terminal L5. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-67f95747fcd4/answer.json b/evidence/final/wiring/tasks/w-67f95747fcd4/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-67f95747fcd4/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-67f95747fcd4/certificate.json b/evidence/final/wiring/tasks/w-67f95747fcd4/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..8e6c1af91a611470d20e557af7b701c39ed938ba --- /dev/null +++ b/evidence/final/wiring/tasks/w-67f95747fcd4/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-67f95747fcd4", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000007 + }, + "spec_hash": "sha256:db773577d21631f1b37062d8a588e76bedff4245505691a85a77f0f443522bb0", + "image_sha256": "38fe5cc39f1e397bd4c6710191bb4d929d1b106fb78b3a313555a67bf9b9e69f", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 1, + "crossings_on_query_wire": 1 + }, + "targets": [], + "spec": { + "seed": 20261208000007, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 1, + 0, + 2, + 3 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 0, + 2, + 3, + 1 + ], + [ + 0, + 3, + 2, + 1 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-67f95747fcd4/task.json b/evidence/final/wiring/tasks/w-67f95747fcd4/task.json new file mode 100644 index 0000000000000000000000000000000000000000..0d071f9204c10b754302a28a6013e8a128420a03 --- /dev/null +++ b/evidence/final/wiring/tasks/w-67f95747fcd4/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-67f95747fcd4", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-69318c20a191/answer.json b/evidence/final/wiring/tasks/w-69318c20a191/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..8b7db7237e6cbef20519d43d0979ad4e6a0c6284 --- /dev/null +++ b/evidence/final/wiring/tasks/w-69318c20a191/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R7", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-69318c20a191/certificate.json b/evidence/final/wiring/tasks/w-69318c20a191/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..b30b3c47dd211ab366980779e9bfcbf6f3d4d212 --- /dev/null +++ b/evidence/final/wiring/tasks/w-69318c20a191/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-69318c20a191", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R7" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000098 + }, + "spec_hash": "sha256:873a5431d2735e93c5874747009c353afb626124e551ba1039b6af1acf98339a", + "image_sha256": "e22c1227fe741de8beae079002c34c011030b876e826fa2c0621fb139c7e8158", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R7 vs R7" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 51, + "crossings_on_query_wire": 6 + }, + "targets": [], + "spec": { + "seed": 20261208000098, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 6, + 8, + 7, + 10, + 9, + 12, + 11, + 13 + ], + [ + 0, + 1, + 4, + 2, + 5, + 3, + 7, + 9, + 6, + 10, + 8, + 11, + 12, + 13 + ], + [ + 0, + 2, + 4, + 1, + 6, + 3, + 8, + 9, + 5, + 11, + 7, + 10, + 13, + 12 + ], + [ + 0, + 3, + 5, + 1, + 7, + 2, + 9, + 8, + 4, + 10, + 6, + 11, + 12, + 13 + ], + [ + 0, + 4, + 6, + 2, + 7, + 1, + 8, + 9, + 3, + 11, + 5, + 10, + 12, + 13 + ], + [ + 1, + 3, + 6, + 2, + 7, + 0, + 8, + 10, + 4, + 11, + 5, + 9, + 12, + 13 + ], + [ + 0, + 2, + 5, + 3, + 8, + 1, + 7, + 9, + 4, + 12, + 6, + 10, + 11, + 13 + ], + [ + 0, + 3, + 4, + 2, + 9, + 1, + 7, + 8, + 5, + 12, + 6, + 10, + 11, + 13 + ], + [ + 1, + 2, + 5, + 3, + 10, + 0, + 7, + 8, + 4, + 11, + 6, + 9, + 12, + 13 + ], + [ + 0, + 2, + 5, + 4, + 9, + 1, + 8, + 7, + 3, + 12, + 6, + 10, + 11, + 13 + ], + [ + 1, + 3, + 4, + 5, + 9, + 0, + 7, + 8, + 2, + 11, + 6, + 10, + 12, + 13 + ], + [ + 0, + 3, + 4, + 5, + 9, + 1, + 8, + 7, + 2, + 11, + 6, + 10, + 13, + 12 + ], + [ + 1, + 4, + 3, + 6, + 10, + 0, + 7, + 8, + 2, + 11, + 5, + 9, + 12, + 13 + ], + [ + 0, + 5, + 2, + 6, + 9, + 1, + 8, + 7, + 3, + 11, + 4, + 10, + 12, + 13 + ], + [ + 1, + 4, + 3, + 6, + 10, + 0, + 7, + 8, + 2, + 12, + 5, + 9, + 11, + 13 + ], + [ + 0, + 4, + 2, + 6, + 9, + 1, + 7, + 8, + 3, + 11, + 5, + 10, + 12, + 13 + ], + [ + 0, + 3, + 1, + 5, + 9, + 2, + 8, + 7, + 4, + 10, + 6, + 11, + 12, + 13 + ], + [ + 1, + 2, + 0, + 5, + 8, + 3, + 9, + 6, + 4, + 10, + 7, + 12, + 11, + 13 + ], + [ + 2, + 1, + 0, + 6, + 7, + 4, + 9, + 5, + 3, + 11, + 8, + 13, + 10, + 12 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-69318c20a191/task.json b/evidence/final/wiring/tasks/w-69318c20a191/task.json new file mode 100644 index 0000000000000000000000000000000000000000..61c7acf992df788b0d41f6130ff8f9d66cbeae14 --- /dev/null +++ b/evidence/final/wiring/tasks/w-69318c20a191/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-69318c20a191", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-698a4d087ad2/answer.json b/evidence/final/wiring/tasks/w-698a4d087ad2/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..2efe02e3e39caa3851a34c8e74193c81a049e9a4 --- /dev/null +++ b/evidence/final/wiring/tasks/w-698a4d087ad2/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R12", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-698a4d087ad2/certificate.json b/evidence/final/wiring/tasks/w-698a4d087ad2/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..81cbb3dcf4e32f2178b4644a4277e4f86c475842 --- /dev/null +++ b/evidence/final/wiring/tasks/w-698a4d087ad2/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-698a4d087ad2", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L12 -> R12" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000097 + }, + "spec_hash": "sha256:65dd55cd7fac7bb75076553fc5d87346b39e0a832c3b5e46bf6b446621a00973", + "image_sha256": "35ed49b5e550c683837cc70e31df553816ccecc14557997d6bae07d80f00e6c0", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R12 vs R12" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 50, + "crossings_on_query_wire": 6 + }, + "targets": [], + "spec": { + "seed": 20261208000097, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 2, + 4, + 3, + 6, + 5, + 7, + 9, + 8, + 10, + 12, + 11, + 13 + ], + [ + 0, + 1, + 3, + 5, + 2, + 6, + 4, + 8, + 10, + 7, + 9, + 11, + 12, + 13 + ], + [ + 0, + 1, + 3, + 6, + 2, + 5, + 4, + 8, + 9, + 7, + 10, + 12, + 11, + 13 + ], + [ + 0, + 2, + 4, + 5, + 1, + 6, + 3, + 9, + 8, + 7, + 11, + 13, + 10, + 12 + ], + [ + 1, + 2, + 5, + 4, + 0, + 6, + 3, + 8, + 9, + 7, + 10, + 12, + 11, + 13 + ], + [ + 0, + 2, + 4, + 5, + 1, + 7, + 3, + 9, + 8, + 6, + 10, + 11, + 12, + 13 + ], + [ + 1, + 3, + 5, + 4, + 0, + 6, + 2, + 9, + 8, + 7, + 11, + 10, + 13, + 12 + ], + [ + 0, + 3, + 4, + 5, + 1, + 7, + 2, + 9, + 8, + 6, + 10, + 11, + 13, + 12 + ], + [ + 0, + 4, + 3, + 6, + 1, + 7, + 2, + 8, + 9, + 5, + 11, + 10, + 12, + 13 + ], + [ + 0, + 3, + 4, + 6, + 2, + 7, + 1, + 9, + 8, + 5, + 10, + 11, + 12, + 13 + ], + [ + 1, + 2, + 4, + 7, + 3, + 6, + 0, + 8, + 9, + 5, + 11, + 10, + 13, + 12 + ], + [ + 0, + 3, + 4, + 7, + 2, + 6, + 1, + 8, + 9, + 5, + 10, + 11, + 13, + 12 + ], + [ + 1, + 4, + 3, + 6, + 2, + 7, + 0, + 9, + 8, + 5, + 10, + 11, + 12, + 13 + ], + [ + 2, + 3, + 4, + 7, + 1, + 6, + 0, + 8, + 9, + 5, + 10, + 12, + 11, + 13 + ], + [ + 3, + 2, + 5, + 6, + 1, + 7, + 0, + 9, + 8, + 4, + 10, + 12, + 11, + 13 + ], + [ + 4, + 2, + 5, + 7, + 1, + 6, + 0, + 10, + 8, + 3, + 9, + 13, + 11, + 12 + ], + [ + 5, + 1, + 4, + 6, + 2, + 7, + 0, + 11, + 9, + 3, + 8, + 13, + 10, + 12 + ], + [ + 4, + 1, + 5, + 7, + 3, + 6, + 0, + 10, + 8, + 2, + 9, + 12, + 11, + 13 + ], + [ + 5, + 1, + 4, + 8, + 2, + 6, + 0, + 9, + 7, + 3, + 10, + 11, + 12, + 13 + ] + ], + "query": 11, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-698a4d087ad2/task.json b/evidence/final/wiring/tasks/w-698a4d087ad2/task.json new file mode 100644 index 0000000000000000000000000000000000000000..76b42fa861e691e6d75deae42445dfcbf610018b --- /dev/null +++ b/evidence/final/wiring/tasks/w-698a4d087ad2/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-698a4d087ad2", + "image": "image.png", + "question": "Follow the wire that starts at terminal L12. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/answer.json b/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/certificate.json b/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..51890e78abe8aadc823f6665c98a01fdc8c2220b --- /dev/null +++ b/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-6bdcd4b8bfa3", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000058 + }, + "spec_hash": "sha256:4b1b06ac7e171bb43013678e846a56dc31c1b946784be862ff2ddff54f804a7a", + "image_sha256": "24b0c968c6d829a5cce4873b68690488950e95bcc4a95ac83f481413d08112ab", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 20, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000058, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5, + 6, + 8, + 7, + 9 + ], + [ + 2, + 0, + 1, + 3, + 4, + 6, + 5, + 7, + 8, + 9 + ], + [ + 2, + 0, + 1, + 4, + 3, + 5, + 6, + 8, + 7, + 9 + ], + [ + 3, + 1, + 0, + 5, + 2, + 4, + 6, + 7, + 8, + 9 + ], + [ + 4, + 2, + 0, + 6, + 1, + 3, + 5, + 8, + 7, + 9 + ], + [ + 5, + 3, + 1, + 6, + 0, + 2, + 4, + 9, + 7, + 8 + ], + [ + 4, + 2, + 0, + 6, + 1, + 3, + 5, + 8, + 7, + 9 + ], + [ + 5, + 1, + 0, + 6, + 2, + 3, + 4, + 7, + 8, + 9 + ], + [ + 4, + 2, + 0, + 6, + 1, + 3, + 5, + 8, + 7, + 9 + ], + [ + 5, + 1, + 0, + 7, + 2, + 3, + 4, + 9, + 6, + 8 + ], + [ + 5, + 2, + 0, + 8, + 1, + 4, + 3, + 9, + 6, + 7 + ], + [ + 4, + 3, + 1, + 9, + 0, + 5, + 2, + 8, + 7, + 6 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/task.json b/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/task.json new file mode 100644 index 0000000000000000000000000000000000000000..f2831af7e4ddb2792883c90f11a314c66ca74917 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6bdcd4b8bfa3/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-6bdcd4b8bfa3", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6e9e083dc54e/answer.json b/evidence/final/wiring/tasks/w-6e9e083dc54e/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..4c11a3bcfe81542229b6755ffb5823f24f45e2f7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6e9e083dc54e/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R6", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6e9e083dc54e/certificate.json b/evidence/final/wiring/tasks/w-6e9e083dc54e/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..bd29bf26e6dc614af47491c4b089b48996827880 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6e9e083dc54e/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-6e9e083dc54e", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R6" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000090 + }, + "spec_hash": "sha256:dacda1060053effbe699489314092aae5777a8fef519e8d13dd96fee8dbcfef6", + "image_sha256": "3dd88028e567993f859056fa1f825a06baa890e4a5352b72d8f4cfd0884cb11f", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R6 vs R6" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 58, + "crossings_on_query_wire": 11 + }, + "targets": [], + "spec": { + "seed": 20261208000090, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 0, + 2, + 1, + 4, + 3, + 6, + 5, + 7, + 9, + 8, + 10, + 11, + 12, + 13 + ], + [ + 1, + 3, + 0, + 5, + 2, + 7, + 4, + 6, + 8, + 9, + 11, + 10, + 12, + 13 + ], + [ + 0, + 2, + 1, + 6, + 3, + 8, + 4, + 5, + 7, + 9, + 10, + 11, + 13, + 12 + ], + [ + 0, + 3, + 1, + 5, + 2, + 7, + 4, + 6, + 8, + 10, + 9, + 12, + 13, + 11 + ], + [ + 0, + 4, + 2, + 5, + 1, + 8, + 3, + 6, + 7, + 9, + 10, + 12, + 13, + 11 + ], + [ + 1, + 5, + 3, + 4, + 0, + 9, + 2, + 7, + 6, + 8, + 11, + 13, + 12, + 10 + ], + [ + 0, + 4, + 2, + 5, + 1, + 9, + 3, + 8, + 6, + 7, + 11, + 13, + 12, + 10 + ], + [ + 1, + 3, + 2, + 5, + 0, + 8, + 4, + 9, + 7, + 6, + 11, + 12, + 13, + 10 + ], + [ + 0, + 2, + 3, + 4, + 1, + 8, + 5, + 10, + 6, + 7, + 12, + 11, + 13, + 9 + ], + [ + 1, + 3, + 2, + 4, + 0, + 7, + 6, + 9, + 5, + 8, + 13, + 11, + 12, + 10 + ], + [ + 0, + 2, + 3, + 5, + 1, + 6, + 7, + 8, + 4, + 9, + 13, + 10, + 12, + 11 + ], + [ + 0, + 1, + 3, + 4, + 2, + 6, + 7, + 9, + 5, + 8, + 13, + 10, + 12, + 11 + ], + [ + 1, + 0, + 3, + 5, + 2, + 7, + 6, + 8, + 4, + 9, + 12, + 10, + 13, + 11 + ], + [ + 2, + 0, + 4, + 5, + 1, + 6, + 7, + 8, + 3, + 9, + 12, + 11, + 13, + 10 + ], + [ + 3, + 1, + 5, + 4, + 0, + 7, + 6, + 9, + 2, + 8, + 12, + 10, + 13, + 11 + ], + [ + 4, + 0, + 5, + 3, + 1, + 8, + 6, + 10, + 2, + 7, + 11, + 9, + 13, + 12 + ], + [ + 3, + 1, + 6, + 4, + 0, + 8, + 5, + 11, + 2, + 7, + 10, + 9, + 13, + 12 + ], + [ + 4, + 2, + 5, + 3, + 0, + 9, + 6, + 10, + 1, + 7, + 11, + 8, + 13, + 12 + ], + [ + 5, + 3, + 4, + 2, + 1, + 8, + 7, + 11, + 0, + 6, + 10, + 9, + 12, + 13 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6e9e083dc54e/task.json b/evidence/final/wiring/tasks/w-6e9e083dc54e/task.json new file mode 100644 index 0000000000000000000000000000000000000000..d6e58d8808bc2f3ca251b5b320365fa9eb7867c3 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6e9e083dc54e/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-6e9e083dc54e", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6f7b5d1f3247/answer.json b/evidence/final/wiring/tasks/w-6f7b5d1f3247/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..496c36e46df4804809f599dfec4218ab894ad906 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6f7b5d1f3247/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R13", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6f7b5d1f3247/certificate.json b/evidence/final/wiring/tasks/w-6f7b5d1f3247/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..eadc98d13f8179e228448893e4ea01664739cfd0 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6f7b5d1f3247/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-6f7b5d1f3247", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L14 -> R13" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000103 + }, + "spec_hash": "sha256:f75fcd299692140eb6f4e88f2dc6048ce75e394e304249f0c7975e0620452527", + "image_sha256": "4e3513d5c964ba58b10f7ac1f61fdbaab25187e0b9ebe38608d81988a1be9745", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R13 vs R13" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 50, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000103, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 7, + 6, + 9, + 8, + 11, + 10, + 13, + 12 + ], + [ + 0, + 1, + 3, + 2, + 5, + 4, + 6, + 7, + 9, + 8, + 10, + 11, + 13, + 12 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 7, + 6, + 9, + 8, + 11, + 10, + 13, + 12 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 2, + 0, + 3, + 1, + 4, + 5, + 6, + 8, + 7, + 9, + 11, + 10, + 13, + 12 + ], + [ + 2, + 0, + 4, + 1, + 3, + 5, + 7, + 8, + 6, + 9, + 10, + 11, + 13, + 12 + ], + [ + 2, + 1, + 3, + 0, + 4, + 6, + 7, + 8, + 5, + 9, + 11, + 10, + 12, + 13 + ], + [ + 3, + 0, + 2, + 1, + 5, + 7, + 6, + 8, + 4, + 10, + 11, + 9, + 13, + 12 + ], + [ + 4, + 1, + 2, + 0, + 6, + 7, + 5, + 8, + 3, + 11, + 10, + 9, + 13, + 12 + ], + [ + 5, + 0, + 2, + 1, + 7, + 6, + 4, + 9, + 3, + 10, + 11, + 8, + 12, + 13 + ], + [ + 6, + 0, + 1, + 2, + 7, + 5, + 3, + 10, + 4, + 9, + 12, + 8, + 11, + 13 + ], + [ + 5, + 0, + 2, + 1, + 8, + 6, + 4, + 9, + 3, + 10, + 11, + 7, + 12, + 13 + ], + [ + 6, + 1, + 3, + 0, + 7, + 5, + 4, + 10, + 2, + 9, + 12, + 8, + 11, + 13 + ], + [ + 7, + 0, + 3, + 1, + 6, + 4, + 5, + 11, + 2, + 9, + 13, + 8, + 10, + 12 + ], + [ + 6, + 0, + 4, + 1, + 7, + 3, + 5, + 11, + 2, + 8, + 12, + 9, + 10, + 13 + ], + [ + 7, + 0, + 5, + 1, + 6, + 2, + 4, + 11, + 3, + 9, + 13, + 8, + 10, + 12 + ], + [ + 7, + 0, + 6, + 2, + 5, + 1, + 3, + 12, + 4, + 10, + 13, + 8, + 9, + 11 + ], + [ + 7, + 0, + 6, + 1, + 5, + 2, + 4, + 11, + 3, + 10, + 13, + 9, + 8, + 12 + ], + [ + 8, + 0, + 5, + 2, + 6, + 1, + 3, + 11, + 4, + 10, + 13, + 9, + 7, + 12 + ] + ], + "query": 13, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-6f7b5d1f3247/task.json b/evidence/final/wiring/tasks/w-6f7b5d1f3247/task.json new file mode 100644 index 0000000000000000000000000000000000000000..f79898cfdeba35fddaddfaf865c0dca4bce05670 --- /dev/null +++ b/evidence/final/wiring/tasks/w-6f7b5d1f3247/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-6f7b5d1f3247", + "image": "image.png", + "question": "Follow the wire that starts at terminal L14. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7380e657d3e6/answer.json b/evidence/final/wiring/tasks/w-7380e657d3e6/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..4c11a3bcfe81542229b6755ffb5823f24f45e2f7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-7380e657d3e6/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R6", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7380e657d3e6/certificate.json b/evidence/final/wiring/tasks/w-7380e657d3e6/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..eef409b51b32b062e115d66b90d12735a6cdbdf3 --- /dev/null +++ b/evidence/final/wiring/tasks/w-7380e657d3e6/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-7380e657d3e6", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L8 -> R6" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000038 + }, + "spec_hash": "sha256:4b7eee08aab7a7c32f7bcd55fac03a26a29bf77d8956aed0a08954cc3925d7d2", + "image_sha256": "b260580cedcfc9d95d6604f05ea54c2d438b1e2316b96ebbb4c26815b92f2c7f", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R6 vs R6" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 12, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000038, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 1, + 0, + 2, + 4, + 3, + 6, + 5, + 7 + ], + [ + 0, + 1, + 3, + 5, + 2, + 7, + 4, + 6 + ], + [ + 0, + 2, + 4, + 6, + 1, + 7, + 3, + 5 + ], + [ + 0, + 2, + 3, + 5, + 1, + 7, + 4, + 6 + ], + [ + 1, + 3, + 2, + 6, + 0, + 7, + 4, + 5 + ], + [ + 0, + 4, + 2, + 7, + 1, + 6, + 3, + 5 + ], + [ + 0, + 3, + 1, + 6, + 2, + 7, + 4, + 5 + ], + [ + 1, + 2, + 0, + 7, + 3, + 6, + 5, + 4 + ], + [ + 0, + 3, + 1, + 6, + 2, + 7, + 4, + 5 + ] + ], + "query": 7, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7380e657d3e6/image.png b/evidence/final/wiring/tasks/w-7380e657d3e6/image.png new file mode 100644 index 0000000000000000000000000000000000000000..c9bc5ed039f831bb99eaf5c35f1978560359b041 Binary files /dev/null and b/evidence/final/wiring/tasks/w-7380e657d3e6/image.png differ diff --git a/evidence/final/wiring/tasks/w-7380e657d3e6/task.json b/evidence/final/wiring/tasks/w-7380e657d3e6/task.json new file mode 100644 index 0000000000000000000000000000000000000000..155fe48bdc2d4b6d749c7cdf8983feeebeb4d091 --- /dev/null +++ b/evidence/final/wiring/tasks/w-7380e657d3e6/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-7380e657d3e6", + "image": "image.png", + "question": "Follow the wire that starts at terminal L8. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-73880a2cee1c/answer.json b/evidence/final/wiring/tasks/w-73880a2cee1c/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..269a7ea426ba2c5c3f50e8292d87378c1f7a5888 --- /dev/null +++ b/evidence/final/wiring/tasks/w-73880a2cee1c/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R5", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-73880a2cee1c/certificate.json b/evidence/final/wiring/tasks/w-73880a2cee1c/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..62874e5cba07387c10544ea950e475ce1bf06d79 --- /dev/null +++ b/evidence/final/wiring/tasks/w-73880a2cee1c/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-73880a2cee1c", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L7 -> R5" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000054 + }, + "spec_hash": "sha256:621db869b7a9af7c3bc23ddd7f8ed0bc3d63cba8fb0149559cbfc7ee92d3f874", + "image_sha256": "ec2ce550e2eb5a9b0b1e4eae9962468a308e1fd4429a0be58e647d288bb679e2", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R5 vs R5" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 8, + "crossings_on_query_wire": 6 + }, + "targets": [], + "spec": { + "seed": 20261208000054, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 0, + 2, + 1, + 3, + 5, + 4, + 6, + 7 + ], + [ + 1, + 3, + 0, + 2, + 6, + 4, + 5, + 7 + ], + [ + 2, + 3, + 0, + 1, + 7, + 5, + 4, + 6 + ], + [ + 3, + 2, + 1, + 0, + 6, + 4, + 5, + 7 + ], + [ + 3, + 1, + 2, + 0, + 5, + 4, + 6, + 7 + ], + [ + 4, + 2, + 1, + 0, + 6, + 3, + 5, + 7 + ], + [ + 4, + 1, + 2, + 0, + 6, + 3, + 5, + 7 + ], + [ + 5, + 1, + 3, + 0, + 6, + 2, + 4, + 7 + ], + [ + 5, + 0, + 3, + 1, + 7, + 2, + 4, + 6 + ] + ], + "query": 6, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-73880a2cee1c/task.json b/evidence/final/wiring/tasks/w-73880a2cee1c/task.json new file mode 100644 index 0000000000000000000000000000000000000000..0a77e040432dd6b75a1233105d4340393f0645b3 --- /dev/null +++ b/evidence/final/wiring/tasks/w-73880a2cee1c/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-73880a2cee1c", + "image": "image.png", + "question": "Follow the wire that starts at terminal L7. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7402c6f42872/answer.json b/evidence/final/wiring/tasks/w-7402c6f42872/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-7402c6f42872/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7402c6f42872/certificate.json b/evidence/final/wiring/tasks/w-7402c6f42872/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..67b2cc013bc1f296e199ac57596bc37c725e7feb --- /dev/null +++ b/evidence/final/wiring/tasks/w-7402c6f42872/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-7402c6f42872", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000014 + }, + "spec_hash": "sha256:c251affd179fd03051f47fff316238e3fc8d60161788ad04f23f84e0361b4a05", + "image_sha256": "cf48770e0df1471d4bec0f8ee4f34f4adc3f49ebc398d5a948a0ddc5b314480b", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 1, + "crossings_on_query_wire": 1 + }, + "targets": [], + "spec": { + "seed": 20261208000014, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 1, + 0, + 2, + 3 + ], + [ + 2, + 0, + 1, + 3 + ], + [ + 3, + 1, + 0, + 2 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7402c6f42872/task.json b/evidence/final/wiring/tasks/w-7402c6f42872/task.json new file mode 100644 index 0000000000000000000000000000000000000000..b454385a6c269a5a25582609d197eac655987ad9 --- /dev/null +++ b/evidence/final/wiring/tasks/w-7402c6f42872/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-7402c6f42872", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7a920afa4994/answer.json b/evidence/final/wiring/tasks/w-7a920afa4994/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-7a920afa4994/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7a920afa4994/certificate.json b/evidence/final/wiring/tasks/w-7a920afa4994/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..efe17438ebad956e8f3226475d93248ccfeb291d --- /dev/null +++ b/evidence/final/wiring/tasks/w-7a920afa4994/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-7a920afa4994", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000085 + }, + "spec_hash": "sha256:ad453ac5b4d0bafde3fee54332955073502ca0e212433ede9925e27c9bb7b150", + "image_sha256": "4a7518de2e7f1fa13383e271b67c399443f03ff7856335b6f9690172082d3606", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 23, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000085, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 3, + 2, + 4, + 6, + 5, + 8, + 7, + 10, + 9, + 11 + ], + [ + 0, + 1, + 3, + 2, + 4, + 7, + 5, + 8, + 6, + 9, + 10, + 11 + ], + [ + 1, + 0, + 2, + 3, + 4, + 8, + 5, + 7, + 6, + 10, + 9, + 11 + ], + [ + 2, + 0, + 1, + 4, + 3, + 7, + 6, + 8, + 5, + 9, + 10, + 11 + ], + [ + 3, + 1, + 0, + 5, + 2, + 6, + 7, + 8, + 4, + 10, + 9, + 11 + ], + [ + 4, + 0, + 1, + 6, + 2, + 5, + 7, + 9, + 3, + 10, + 8, + 11 + ], + [ + 3, + 1, + 0, + 7, + 2, + 5, + 6, + 8, + 4, + 11, + 9, + 10 + ], + [ + 4, + 2, + 0, + 7, + 1, + 5, + 6, + 9, + 3, + 11, + 8, + 10 + ], + [ + 3, + 1, + 0, + 7, + 2, + 6, + 5, + 8, + 4, + 11, + 9, + 10 + ], + [ + 2, + 0, + 1, + 6, + 3, + 7, + 4, + 9, + 5, + 10, + 8, + 11 + ], + [ + 2, + 0, + 1, + 6, + 3, + 8, + 4, + 10, + 5, + 9, + 7, + 11 + ], + [ + 1, + 0, + 2, + 7, + 3, + 9, + 4, + 11, + 5, + 8, + 6, + 10 + ], + [ + 0, + 1, + 3, + 7, + 2, + 10, + 5, + 11, + 4, + 8, + 6, + 9 + ], + [ + 1, + 0, + 2, + 8, + 3, + 10, + 6, + 11, + 4, + 7, + 5, + 9 + ], + [ + 2, + 0, + 1, + 8, + 4, + 9, + 6, + 11, + 3, + 7, + 5, + 10 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-7a920afa4994/task.json b/evidence/final/wiring/tasks/w-7a920afa4994/task.json new file mode 100644 index 0000000000000000000000000000000000000000..bf289dd43b1f3315a6acf0981a1ca1e6b343b4fa --- /dev/null +++ b/evidence/final/wiring/tasks/w-7a920afa4994/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-7a920afa4994", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8180207d8fc4/answer.json b/evidence/final/wiring/tasks/w-8180207d8fc4/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-8180207d8fc4/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8180207d8fc4/certificate.json b/evidence/final/wiring/tasks/w-8180207d8fc4/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..573f033ab26cddb15fd563c2620f6b5f73c75034 --- /dev/null +++ b/evidence/final/wiring/tasks/w-8180207d8fc4/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-8180207d8fc4", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000068 + }, + "spec_hash": "sha256:39048cadc0e695e65c12c29078d5d94269616b46a5b3b8269e7f8b7e6ef18d48", + "image_sha256": "ce6124abb81c30622898956c56cc87e760a60e45eb3977d9d87b5721e17c03e0", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 25, + "crossings_on_query_wire": 11 + }, + "targets": [], + "spec": { + "seed": 20261208000068, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 2, + 1, + 4, + 3, + 5, + 7, + 6, + 8, + 9 + ], + [ + 1, + 3, + 0, + 4, + 2, + 6, + 7, + 5, + 9, + 8 + ], + [ + 0, + 4, + 1, + 3, + 2, + 5, + 8, + 6, + 9, + 7 + ], + [ + 1, + 4, + 0, + 3, + 2, + 5, + 8, + 7, + 9, + 6 + ], + [ + 0, + 5, + 1, + 2, + 3, + 4, + 9, + 7, + 8, + 6 + ], + [ + 1, + 5, + 0, + 2, + 4, + 3, + 9, + 8, + 7, + 6 + ], + [ + 0, + 5, + 1, + 3, + 4, + 2, + 8, + 9, + 7, + 6 + ], + [ + 1, + 4, + 0, + 3, + 5, + 2, + 9, + 8, + 6, + 7 + ], + [ + 0, + 3, + 1, + 4, + 6, + 2, + 9, + 7, + 5, + 8 + ], + [ + 1, + 2, + 0, + 5, + 7, + 3, + 9, + 6, + 4, + 8 + ], + [ + 0, + 3, + 1, + 4, + 6, + 2, + 8, + 7, + 5, + 9 + ], + [ + 1, + 3, + 0, + 5, + 6, + 2, + 7, + 8, + 4, + 9 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8180207d8fc4/task.json b/evidence/final/wiring/tasks/w-8180207d8fc4/task.json new file mode 100644 index 0000000000000000000000000000000000000000..72b741bda69e03ea50d53bf1a0b64082d24571e3 --- /dev/null +++ b/evidence/final/wiring/tasks/w-8180207d8fc4/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-8180207d8fc4", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8dc769237172/answer.json b/evidence/final/wiring/tasks/w-8dc769237172/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-8dc769237172/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8dc769237172/certificate.json b/evidence/final/wiring/tasks/w-8dc769237172/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..d1916d705334d4d5c2b7edda4288472d31bd0473 --- /dev/null +++ b/evidence/final/wiring/tasks/w-8dc769237172/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-8dc769237172", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L2 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000079 + }, + "spec_hash": "sha256:cf6ad93820a987034b7f4aaa1613f2b38f22b552c112684106228cbc1858fd51", + "image_sha256": "26732089f48cfbd75e689981343d198587e1d217a8506c17fb3c5d0e48d24b3c", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 22, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000079, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 0, + 2, + 1, + 3, + 5, + 4, + 6, + 7, + 9, + 8, + 11, + 10 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 9, + 7, + 10, + 11 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5, + 7, + 9, + 8, + 6, + 11, + 10 + ], + [ + 0, + 1, + 3, + 4, + 2, + 6, + 8, + 10, + 7, + 5, + 11, + 9 + ], + [ + 1, + 0, + 4, + 3, + 2, + 5, + 9, + 10, + 7, + 6, + 11, + 8 + ], + [ + 2, + 0, + 5, + 3, + 1, + 4, + 8, + 11, + 6, + 7, + 10, + 9 + ], + [ + 1, + 0, + 6, + 4, + 2, + 3, + 9, + 10, + 5, + 7, + 11, + 8 + ], + [ + 2, + 0, + 6, + 3, + 1, + 4, + 10, + 9, + 5, + 8, + 11, + 7 + ], + [ + 2, + 1, + 6, + 4, + 0, + 3, + 9, + 10, + 5, + 8, + 11, + 7 + ], + [ + 3, + 0, + 5, + 4, + 1, + 2, + 8, + 10, + 6, + 9, + 11, + 7 + ], + [ + 2, + 1, + 5, + 4, + 0, + 3, + 8, + 9, + 7, + 10, + 11, + 6 + ], + [ + 3, + 0, + 6, + 4, + 1, + 2, + 8, + 10, + 7, + 9, + 11, + 5 + ], + [ + 3, + 0, + 5, + 4, + 1, + 2, + 7, + 11, + 8, + 9, + 10, + 6 + ], + [ + 3, + 0, + 6, + 4, + 2, + 1, + 8, + 11, + 7, + 10, + 9, + 5 + ], + [ + 3, + 0, + 5, + 4, + 1, + 2, + 9, + 11, + 7, + 10, + 8, + 6 + ] + ], + "query": 1, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8dc769237172/task.json b/evidence/final/wiring/tasks/w-8dc769237172/task.json new file mode 100644 index 0000000000000000000000000000000000000000..8e06ddd73a3c4c8d836bda3ecc535c65f75e40bd --- /dev/null +++ b/evidence/final/wiring/tasks/w-8dc769237172/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-8dc769237172", + "image": "image.png", + "question": "Follow the wire that starts at terminal L2. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8e3b3e66ec98/answer.json b/evidence/final/wiring/tasks/w-8e3b3e66ec98/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..da2884c83250e57d3e92be71061db586007d0bd4 --- /dev/null +++ b/evidence/final/wiring/tasks/w-8e3b3e66ec98/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R10", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8e3b3e66ec98/certificate.json b/evidence/final/wiring/tasks/w-8e3b3e66ec98/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..cf3e24df2538d6890291e8c53be347fa9a27a9fa --- /dev/null +++ b/evidence/final/wiring/tasks/w-8e3b3e66ec98/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-8e3b3e66ec98", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L5 -> R10" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000084 + }, + "spec_hash": "sha256:52499832bc2b90b84e38d67c2606dc23bb5b28e1a2e14592dd77d99a51b5558f", + "image_sha256": "411d586234d0dad27d1f38ade1571c8bb8401c92b063f3ce3528e9cce66c416c", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R10 vs R10" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 19, + "crossings_on_query_wire": 9 + }, + "targets": [], + "spec": { + "seed": 20261208000084, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 0, + 1, + 2, + 3, + 5, + 4, + 6, + 7, + 8, + 10, + 9, + 11 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5, + 7, + 6, + 8, + 9, + 10, + 11 + ], + [ + 2, + 0, + 3, + 1, + 5, + 4, + 7, + 6, + 9, + 8, + 10, + 11 + ], + [ + 3, + 0, + 2, + 1, + 5, + 4, + 6, + 7, + 8, + 9, + 11, + 10 + ], + [ + 2, + 1, + 3, + 0, + 6, + 4, + 5, + 7, + 8, + 10, + 11, + 9 + ], + [ + 1, + 2, + 3, + 0, + 7, + 5, + 4, + 6, + 9, + 11, + 10, + 8 + ], + [ + 0, + 3, + 2, + 1, + 8, + 4, + 5, + 6, + 10, + 11, + 9, + 7 + ], + [ + 1, + 2, + 3, + 0, + 7, + 5, + 4, + 6, + 9, + 11, + 10, + 8 + ], + [ + 2, + 1, + 4, + 0, + 7, + 6, + 3, + 5, + 10, + 11, + 9, + 8 + ], + [ + 3, + 0, + 4, + 1, + 6, + 7, + 2, + 5, + 11, + 10, + 8, + 9 + ], + [ + 2, + 0, + 4, + 1, + 5, + 7, + 3, + 6, + 11, + 10, + 8, + 9 + ], + [ + 3, + 1, + 4, + 0, + 6, + 7, + 2, + 5, + 10, + 11, + 9, + 8 + ], + [ + 2, + 0, + 4, + 1, + 7, + 6, + 3, + 5, + 10, + 11, + 9, + 8 + ], + [ + 3, + 1, + 4, + 0, + 8, + 6, + 2, + 5, + 11, + 10, + 9, + 7 + ], + [ + 2, + 0, + 5, + 1, + 9, + 7, + 3, + 4, + 11, + 10, + 8, + 6 + ] + ], + "query": 4, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-8e3b3e66ec98/task.json b/evidence/final/wiring/tasks/w-8e3b3e66ec98/task.json new file mode 100644 index 0000000000000000000000000000000000000000..9df09deb981151d7e6e1f2a9889a9e9cbb34a0c7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-8e3b3e66ec98/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-8e3b3e66ec98", + "image": "image.png", + "question": "Follow the wire that starts at terminal L5. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-998f580aad33/answer.json b/evidence/final/wiring/tasks/w-998f580aad33/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..8b7db7237e6cbef20519d43d0979ad4e6a0c6284 --- /dev/null +++ b/evidence/final/wiring/tasks/w-998f580aad33/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R7", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-998f580aad33/certificate.json b/evidence/final/wiring/tasks/w-998f580aad33/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..15d6d69802f8a8600f69167add236a541eb1cdc5 --- /dev/null +++ b/evidence/final/wiring/tasks/w-998f580aad33/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-998f580aad33", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R7" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000060 + }, + "spec_hash": "sha256:8f13099c253d3e0b89642b91959093df24e9b618e7e943dc4184fdf43a71a3ac", + "image_sha256": "e393e1b43011cfe60cde909d0c9856f7a8e5973cefa7bb86a62a4851b0369186", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R7 vs R7" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 23, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000060, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 2, + 1, + 3, + 5, + 4, + 7, + 6, + 9, + 8 + ], + [ + 1, + 3, + 0, + 2, + 6, + 4, + 7, + 5, + 8, + 9 + ], + [ + 0, + 2, + 1, + 3, + 5, + 4, + 8, + 6, + 7, + 9 + ], + [ + 1, + 2, + 0, + 4, + 5, + 3, + 8, + 6, + 7, + 9 + ], + [ + 1, + 2, + 0, + 3, + 5, + 4, + 7, + 6, + 8, + 9 + ], + [ + 0, + 2, + 1, + 4, + 6, + 3, + 8, + 5, + 7, + 9 + ], + [ + 0, + 3, + 1, + 4, + 5, + 2, + 8, + 6, + 7, + 9 + ], + [ + 1, + 3, + 0, + 5, + 4, + 2, + 8, + 6, + 7, + 9 + ], + [ + 2, + 4, + 0, + 5, + 3, + 1, + 8, + 7, + 6, + 9 + ], + [ + 2, + 3, + 1, + 6, + 4, + 0, + 7, + 8, + 5, + 9 + ], + [ + 3, + 2, + 0, + 5, + 4, + 1, + 8, + 7, + 6, + 9 + ], + [ + 3, + 2, + 1, + 6, + 4, + 0, + 7, + 8, + 5, + 9 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-998f580aad33/task.json b/evidence/final/wiring/tasks/w-998f580aad33/task.json new file mode 100644 index 0000000000000000000000000000000000000000..518e71f29cabbb7548490c636f09b6bc8e517a3b --- /dev/null +++ b/evidence/final/wiring/tasks/w-998f580aad33/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-998f580aad33", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-9b8b29e3e384/answer.json b/evidence/final/wiring/tasks/w-9b8b29e3e384/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..8b7db7237e6cbef20519d43d0979ad4e6a0c6284 --- /dev/null +++ b/evidence/final/wiring/tasks/w-9b8b29e3e384/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R7", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-9b8b29e3e384/certificate.json b/evidence/final/wiring/tasks/w-9b8b29e3e384/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..4fed343a989ee9261f2925a3ff7ad90d20df7b83 --- /dev/null +++ b/evidence/final/wiring/tasks/w-9b8b29e3e384/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-9b8b29e3e384", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L8 -> R7" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000096 + }, + "spec_hash": "sha256:3c081cea113692c4bfb15032cfb400e17fea263918850241d929733a6bf1c421", + "image_sha256": "214bf443eb582b1884e9950e5b3778d4b4083eb71938b05df676c40e6bc8a5ac", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R7 vs R7" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 51, + "crossings_on_query_wire": 8 + }, + "targets": [], + "spec": { + "seed": 20261208000096, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5, + 7, + 6, + 9, + 8, + 11, + 10, + 13, + 12 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 8, + 5, + 10, + 7, + 12, + 9, + 13, + 11 + ], + [ + 1, + 0, + 3, + 2, + 5, + 6, + 7, + 4, + 10, + 8, + 11, + 9, + 13, + 12 + ], + [ + 0, + 1, + 3, + 2, + 6, + 5, + 8, + 4, + 9, + 7, + 12, + 10, + 13, + 11 + ], + [ + 0, + 2, + 4, + 1, + 7, + 5, + 8, + 3, + 10, + 6, + 11, + 9, + 13, + 12 + ], + [ + 0, + 1, + 3, + 2, + 8, + 6, + 7, + 4, + 11, + 5, + 10, + 9, + 13, + 12 + ], + [ + 1, + 0, + 2, + 3, + 9, + 7, + 6, + 5, + 12, + 4, + 10, + 8, + 13, + 11 + ], + [ + 0, + 1, + 2, + 4, + 9, + 8, + 5, + 6, + 11, + 3, + 10, + 7, + 13, + 12 + ], + [ + 0, + 1, + 2, + 3, + 8, + 9, + 5, + 7, + 12, + 4, + 10, + 6, + 13, + 11 + ], + [ + 1, + 0, + 2, + 4, + 9, + 8, + 5, + 6, + 12, + 3, + 11, + 7, + 13, + 10 + ], + [ + 0, + 1, + 2, + 3, + 9, + 8, + 5, + 7, + 13, + 4, + 10, + 6, + 12, + 11 + ], + [ + 1, + 0, + 3, + 2, + 9, + 7, + 6, + 8, + 13, + 4, + 10, + 5, + 12, + 11 + ], + [ + 0, + 1, + 2, + 3, + 9, + 8, + 5, + 7, + 12, + 4, + 11, + 6, + 13, + 10 + ], + [ + 1, + 0, + 2, + 4, + 10, + 7, + 6, + 8, + 13, + 3, + 11, + 5, + 12, + 9 + ], + [ + 0, + 1, + 3, + 4, + 9, + 8, + 5, + 7, + 13, + 2, + 12, + 6, + 11, + 10 + ], + [ + 0, + 1, + 2, + 5, + 8, + 9, + 4, + 6, + 13, + 3, + 11, + 7, + 12, + 10 + ], + [ + 0, + 1, + 2, + 5, + 8, + 10, + 3, + 7, + 13, + 4, + 12, + 6, + 11, + 9 + ], + [ + 1, + 0, + 2, + 6, + 9, + 11, + 3, + 7, + 12, + 4, + 13, + 5, + 10, + 8 + ], + [ + 2, + 0, + 1, + 7, + 8, + 10, + 3, + 6, + 12, + 4, + 13, + 5, + 11, + 9 + ] + ], + "query": 7, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-9b8b29e3e384/task.json b/evidence/final/wiring/tasks/w-9b8b29e3e384/task.json new file mode 100644 index 0000000000000000000000000000000000000000..59be5c8d0aaffe910eef3cd2193aace471e9634d --- /dev/null +++ b/evidence/final/wiring/tasks/w-9b8b29e3e384/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-9b8b29e3e384", + "image": "image.png", + "question": "Follow the wire that starts at terminal L8. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-9bdce42fc974/answer.json b/evidence/final/wiring/tasks/w-9bdce42fc974/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-9bdce42fc974/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-9bdce42fc974/certificate.json b/evidence/final/wiring/tasks/w-9bdce42fc974/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..c9238bc513e8285c6b5492de9e6da46cf76ef95d --- /dev/null +++ b/evidence/final/wiring/tasks/w-9bdce42fc974/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-9bdce42fc974", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000099 + }, + "spec_hash": "sha256:e4deaa691c304dbfec29e59ac10e8d708bb403469765bf526340bf89c9da9f20", + "image_sha256": "302d00fb12a403ca897514f4bae6abfb900186ccfcc83ef6c53c63d06737cc7c", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 51, + "crossings_on_query_wire": 13 + }, + "targets": [], + "spec": { + "seed": 20261208000099, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 0, + 2, + 1, + 4, + 3, + 6, + 5, + 8, + 7, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 3, + 0, + 5, + 2, + 6, + 4, + 7, + 8, + 10, + 9, + 12, + 11, + 13 + ], + [ + 0, + 2, + 1, + 5, + 3, + 6, + 4, + 8, + 7, + 9, + 10, + 13, + 11, + 12 + ], + [ + 1, + 3, + 0, + 4, + 2, + 6, + 5, + 7, + 8, + 9, + 10, + 13, + 11, + 12 + ], + [ + 1, + 3, + 0, + 5, + 2, + 6, + 4, + 8, + 7, + 9, + 11, + 12, + 10, + 13 + ], + [ + 2, + 4, + 0, + 5, + 1, + 6, + 3, + 7, + 8, + 9, + 11, + 13, + 10, + 12 + ], + [ + 2, + 3, + 1, + 6, + 0, + 5, + 4, + 7, + 8, + 9, + 10, + 12, + 11, + 13 + ], + [ + 1, + 3, + 2, + 6, + 0, + 4, + 5, + 7, + 9, + 8, + 10, + 11, + 12, + 13 + ], + [ + 0, + 2, + 3, + 6, + 1, + 5, + 4, + 8, + 10, + 7, + 9, + 12, + 11, + 13 + ], + [ + 1, + 2, + 4, + 7, + 0, + 5, + 3, + 9, + 11, + 6, + 8, + 13, + 10, + 12 + ], + [ + 1, + 2, + 3, + 8, + 0, + 6, + 4, + 10, + 11, + 5, + 7, + 13, + 9, + 12 + ], + [ + 2, + 1, + 3, + 8, + 0, + 5, + 4, + 9, + 11, + 6, + 7, + 13, + 10, + 12 + ], + [ + 2, + 0, + 4, + 7, + 1, + 5, + 3, + 10, + 12, + 6, + 8, + 13, + 9, + 11 + ], + [ + 2, + 1, + 3, + 8, + 0, + 6, + 4, + 9, + 11, + 5, + 7, + 13, + 10, + 12 + ], + [ + 1, + 2, + 4, + 7, + 0, + 6, + 3, + 10, + 12, + 5, + 8, + 13, + 9, + 11 + ], + [ + 0, + 3, + 5, + 6, + 1, + 7, + 2, + 11, + 13, + 4, + 9, + 12, + 8, + 10 + ], + [ + 1, + 2, + 4, + 7, + 0, + 6, + 3, + 10, + 12, + 5, + 8, + 13, + 9, + 11 + ], + [ + 0, + 3, + 4, + 6, + 1, + 7, + 2, + 9, + 11, + 5, + 8, + 13, + 10, + 12 + ], + [ + 1, + 4, + 3, + 5, + 0, + 7, + 2, + 8, + 12, + 6, + 9, + 13, + 10, + 11 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-9bdce42fc974/task.json b/evidence/final/wiring/tasks/w-9bdce42fc974/task.json new file mode 100644 index 0000000000000000000000000000000000000000..833f8c4b55b6a00672afb852041e376be122f84e --- /dev/null +++ b/evidence/final/wiring/tasks/w-9bdce42fc974/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-9bdce42fc974", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a1b6f658313a/answer.json b/evidence/final/wiring/tasks/w-a1b6f658313a/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..6768ff6c53a4e672438d926736038beb3fa240ca --- /dev/null +++ b/evidence/final/wiring/tasks/w-a1b6f658313a/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R3", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a1b6f658313a/certificate.json b/evidence/final/wiring/tasks/w-a1b6f658313a/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..fe476baec88627d78d24760039dd86a1158c47cd --- /dev/null +++ b/evidence/final/wiring/tasks/w-a1b6f658313a/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-a1b6f658313a", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L5 -> R3" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000091 + }, + "spec_hash": "sha256:efa1e0f5d58f5686b0ae91b7700d8ece2ec928839803086f13413b2668f95a58", + "image_sha256": "e0bf92644db56342026164aa54d5e1ec50d9d40d45dac510e8b212b7317986a6", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R3 vs R3" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 59, + "crossings_on_query_wire": 2 + }, + "targets": [], + "spec": { + "seed": 20261208000091, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 2, + 4, + 3, + 6, + 5, + 7, + 9, + 8, + 11, + 10, + 13, + 12 + ], + [ + 0, + 1, + 3, + 5, + 2, + 6, + 4, + 8, + 10, + 7, + 12, + 9, + 13, + 11 + ], + [ + 0, + 2, + 4, + 5, + 1, + 7, + 3, + 8, + 11, + 6, + 12, + 9, + 13, + 10 + ], + [ + 0, + 1, + 5, + 4, + 2, + 6, + 3, + 9, + 10, + 7, + 13, + 8, + 12, + 11 + ], + [ + 1, + 0, + 4, + 5, + 3, + 7, + 2, + 8, + 10, + 6, + 13, + 9, + 12, + 11 + ], + [ + 2, + 0, + 3, + 6, + 4, + 8, + 1, + 7, + 9, + 5, + 13, + 10, + 11, + 12 + ], + [ + 2, + 1, + 4, + 5, + 3, + 7, + 0, + 8, + 9, + 6, + 12, + 11, + 10, + 13 + ], + [ + 2, + 0, + 3, + 6, + 4, + 7, + 1, + 8, + 9, + 5, + 12, + 10, + 11, + 13 + ], + [ + 2, + 1, + 4, + 5, + 3, + 8, + 0, + 7, + 10, + 6, + 11, + 9, + 12, + 13 + ], + [ + 2, + 0, + 3, + 5, + 4, + 8, + 1, + 7, + 9, + 6, + 12, + 10, + 11, + 13 + ], + [ + 3, + 1, + 2, + 6, + 4, + 7, + 0, + 8, + 10, + 5, + 11, + 9, + 12, + 13 + ], + [ + 4, + 0, + 2, + 5, + 3, + 8, + 1, + 7, + 11, + 6, + 10, + 9, + 12, + 13 + ], + [ + 5, + 0, + 1, + 4, + 3, + 9, + 2, + 6, + 11, + 7, + 10, + 8, + 12, + 13 + ], + [ + 6, + 1, + 0, + 3, + 4, + 9, + 2, + 5, + 12, + 8, + 10, + 7, + 11, + 13 + ], + [ + 5, + 2, + 0, + 4, + 3, + 8, + 1, + 6, + 13, + 9, + 10, + 7, + 11, + 12 + ], + [ + 4, + 3, + 1, + 5, + 2, + 9, + 0, + 7, + 12, + 8, + 11, + 6, + 10, + 13 + ], + [ + 5, + 2, + 0, + 4, + 3, + 9, + 1, + 8, + 13, + 7, + 10, + 6, + 11, + 12 + ], + [ + 4, + 3, + 1, + 5, + 2, + 10, + 0, + 8, + 13, + 6, + 9, + 7, + 11, + 12 + ], + [ + 3, + 4, + 0, + 5, + 2, + 11, + 1, + 9, + 13, + 6, + 8, + 7, + 10, + 12 + ] + ], + "query": 4, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a1b6f658313a/task.json b/evidence/final/wiring/tasks/w-a1b6f658313a/task.json new file mode 100644 index 0000000000000000000000000000000000000000..2df2a277a79ad3cbb4f8c8d390c4f119e411caa9 --- /dev/null +++ b/evidence/final/wiring/tasks/w-a1b6f658313a/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-a1b6f658313a", + "image": "image.png", + "question": "Follow the wire that starts at terminal L5. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a52597e4d8a9/answer.json b/evidence/final/wiring/tasks/w-a52597e4d8a9/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-a52597e4d8a9/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a52597e4d8a9/certificate.json b/evidence/final/wiring/tasks/w-a52597e4d8a9/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..83b5f84aa50733866cc0609bb96a01609814b82b --- /dev/null +++ b/evidence/final/wiring/tasks/w-a52597e4d8a9/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-a52597e4d8a9", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000003 + }, + "spec_hash": "sha256:7af20e6d60336230e2191f3eadd90b8e990852f1dcc108eeec26bb498d4c477d", + "image_sha256": "7732f14b6f735f040970af01f15292fe3f71d49c4b4863e419b2b1c3abac4862", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 1, + "crossings_on_query_wire": 1 + }, + "targets": [], + "spec": { + "seed": 20261208000003, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 0, + 2, + 3, + 1 + ], + [ + 1, + 3, + 2, + 0 + ], + [ + 0, + 3, + 2, + 1 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a52597e4d8a9/task.json b/evidence/final/wiring/tasks/w-a52597e4d8a9/task.json new file mode 100644 index 0000000000000000000000000000000000000000..745b3d9f52057c8ef961afc787614f7a84f2f4db --- /dev/null +++ b/evidence/final/wiring/tasks/w-a52597e4d8a9/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-a52597e4d8a9", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a556565706bc/answer.json b/evidence/final/wiring/tasks/w-a556565706bc/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-a556565706bc/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a556565706bc/certificate.json b/evidence/final/wiring/tasks/w-a556565706bc/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..acf401e552ca8dae4038ba04172f2fa3fea2fb4f --- /dev/null +++ b/evidence/final/wiring/tasks/w-a556565706bc/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-a556565706bc", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L7 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000076 + }, + "spec_hash": "sha256:76e93c277e7f3b1d30f2fad1a5ae1529cb21114b842f998be1be813048a2b8ae", + "image_sha256": "fa9cc7eee8bac2bbdf7297cbbee485a2235aea2761e6a16911d547605c5f255c", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 24, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000076, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 3, + 2, + 4, + 6, + 5, + 8, + 7, + 10, + 9, + 11 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 5, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 10, + 9, + 11 + ], + [ + 0, + 1, + 3, + 2, + 5, + 4, + 6, + 8, + 7, + 11, + 9, + 10 + ], + [ + 0, + 1, + 4, + 2, + 6, + 3, + 5, + 8, + 7, + 10, + 9, + 11 + ], + [ + 0, + 1, + 4, + 3, + 7, + 2, + 5, + 9, + 6, + 11, + 8, + 10 + ], + [ + 1, + 0, + 4, + 2, + 8, + 3, + 6, + 10, + 5, + 11, + 7, + 9 + ], + [ + 2, + 0, + 3, + 1, + 9, + 4, + 5, + 10, + 6, + 11, + 7, + 8 + ], + [ + 3, + 0, + 2, + 1, + 9, + 5, + 4, + 11, + 7, + 10, + 6, + 8 + ], + [ + 4, + 0, + 1, + 2, + 10, + 6, + 3, + 11, + 8, + 9, + 5, + 7 + ], + [ + 5, + 1, + 0, + 3, + 11, + 7, + 2, + 10, + 9, + 8, + 4, + 6 + ], + [ + 4, + 2, + 0, + 3, + 11, + 8, + 1, + 10, + 9, + 7, + 5, + 6 + ], + [ + 3, + 2, + 1, + 4, + 11, + 7, + 0, + 9, + 10, + 8, + 6, + 5 + ], + [ + 2, + 3, + 1, + 5, + 10, + 7, + 0, + 8, + 11, + 9, + 6, + 4 + ], + [ + 2, + 3, + 0, + 6, + 11, + 7, + 1, + 9, + 10, + 8, + 5, + 4 + ] + ], + "query": 6, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a556565706bc/task.json b/evidence/final/wiring/tasks/w-a556565706bc/task.json new file mode 100644 index 0000000000000000000000000000000000000000..338994bd698be1b9c762024f18161b3caef14db0 --- /dev/null +++ b/evidence/final/wiring/tasks/w-a556565706bc/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-a556565706bc", + "image": "image.png", + "question": "Follow the wire that starts at terminal L7. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a68637dc9ab4/answer.json b/evidence/final/wiring/tasks/w-a68637dc9ab4/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-a68637dc9ab4/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a68637dc9ab4/certificate.json b/evidence/final/wiring/tasks/w-a68637dc9ab4/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..ebd0562701ec7222fa499439a0d52245f92473fa --- /dev/null +++ b/evidence/final/wiring/tasks/w-a68637dc9ab4/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-a68637dc9ab4", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L6 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000023 + }, + "spec_hash": "sha256:fc30b157c7ade0e7ffc2411016ec9b3c01582388640aec698470ef71fa51c983", + "image_sha256": "490423e3ea2a3c34ca7284b3586a030c37b91b2696f134c4e0fda662301aab96", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 5, + "crossings_on_query_wire": 2 + }, + "targets": [], + "spec": { + "seed": 20261208000023, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5 + ], + [ + 0, + 1, + 2, + 5, + 3, + 4 + ], + [ + 0, + 2, + 1, + 5, + 4, + 3 + ], + [ + 1, + 3, + 0, + 5, + 4, + 2 + ], + [ + 2, + 4, + 0, + 5, + 3, + 1 + ] + ], + "query": 5, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a68637dc9ab4/image.png b/evidence/final/wiring/tasks/w-a68637dc9ab4/image.png new file mode 100644 index 0000000000000000000000000000000000000000..a859e3b218ec9c3b0b0bff799b20271665fbdf08 Binary files /dev/null and b/evidence/final/wiring/tasks/w-a68637dc9ab4/image.png differ diff --git a/evidence/final/wiring/tasks/w-a68637dc9ab4/task.json b/evidence/final/wiring/tasks/w-a68637dc9ab4/task.json new file mode 100644 index 0000000000000000000000000000000000000000..f0c0006da4d19c5b0c986c32a705f0040354c7d6 --- /dev/null +++ b/evidence/final/wiring/tasks/w-a68637dc9ab4/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-a68637dc9ab4", + "image": "image.png", + "question": "Follow the wire that starts at terminal L6. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a90a10cde4d9/answer.json b/evidence/final/wiring/tasks/w-a90a10cde4d9/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..4c11a3bcfe81542229b6755ffb5823f24f45e2f7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-a90a10cde4d9/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R6", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a90a10cde4d9/certificate.json b/evidence/final/wiring/tasks/w-a90a10cde4d9/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..cf585ed59e3a5e7fd75ba5c36d7a0e3a7a75f189 --- /dev/null +++ b/evidence/final/wiring/tasks/w-a90a10cde4d9/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-a90a10cde4d9", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R6" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000093 + }, + "spec_hash": "sha256:4c8e12798068803d4fd3af021b3487c81bd0bee7763a501524894b39b24331ef", + "image_sha256": "12db8074c3418b6f5a87c57902694d577b4989147eed38b5214fefec6e1f00f7", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R6 vs R6" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 60, + "crossings_on_query_wire": 7 + }, + "targets": [], + "spec": { + "seed": 20261208000093, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 6, + 8, + 7, + 10, + 9, + 12, + 11, + 13 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 10, + 9, + 12, + 11, + 13 + ], + [ + 0, + 1, + 3, + 2, + 5, + 4, + 7, + 6, + 9, + 11, + 8, + 12, + 10, + 13 + ], + [ + 1, + 0, + 4, + 2, + 6, + 3, + 8, + 5, + 9, + 10, + 7, + 13, + 11, + 12 + ], + [ + 0, + 1, + 5, + 2, + 7, + 3, + 9, + 4, + 8, + 11, + 6, + 13, + 10, + 12 + ], + [ + 1, + 0, + 4, + 3, + 6, + 2, + 8, + 5, + 9, + 11, + 7, + 12, + 10, + 13 + ], + [ + 0, + 1, + 5, + 2, + 7, + 3, + 9, + 4, + 8, + 10, + 6, + 13, + 11, + 12 + ], + [ + 1, + 0, + 4, + 3, + 6, + 2, + 8, + 5, + 9, + 11, + 7, + 12, + 10, + 13 + ], + [ + 2, + 0, + 3, + 4, + 6, + 1, + 7, + 5, + 10, + 12, + 8, + 11, + 9, + 13 + ], + [ + 3, + 1, + 2, + 4, + 5, + 0, + 7, + 6, + 11, + 12, + 9, + 10, + 8, + 13 + ], + [ + 3, + 0, + 2, + 5, + 4, + 1, + 6, + 7, + 12, + 11, + 10, + 9, + 8, + 13 + ], + [ + 2, + 1, + 3, + 5, + 4, + 0, + 6, + 8, + 12, + 11, + 9, + 10, + 7, + 13 + ], + [ + 2, + 0, + 4, + 5, + 3, + 1, + 6, + 9, + 11, + 12, + 8, + 10, + 7, + 13 + ], + [ + 3, + 1, + 5, + 4, + 2, + 0, + 6, + 10, + 11, + 12, + 7, + 9, + 8, + 13 + ], + [ + 2, + 0, + 4, + 5, + 3, + 1, + 6, + 9, + 12, + 11, + 8, + 10, + 7, + 13 + ], + [ + 3, + 1, + 5, + 4, + 2, + 0, + 7, + 8, + 13, + 10, + 9, + 11, + 6, + 12 + ], + [ + 3, + 2, + 4, + 5, + 1, + 0, + 8, + 7, + 13, + 9, + 10, + 12, + 6, + 11 + ], + [ + 3, + 2, + 4, + 6, + 0, + 1, + 9, + 7, + 12, + 8, + 11, + 13, + 5, + 10 + ], + [ + 4, + 2, + 3, + 5, + 0, + 1, + 9, + 8, + 13, + 7, + 10, + 12, + 6, + 11 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-a90a10cde4d9/task.json b/evidence/final/wiring/tasks/w-a90a10cde4d9/task.json new file mode 100644 index 0000000000000000000000000000000000000000..7a5963b842e75b2a790ffa0b5605047282683935 --- /dev/null +++ b/evidence/final/wiring/tasks/w-a90a10cde4d9/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-a90a10cde4d9", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-aae0754573b8/answer.json b/evidence/final/wiring/tasks/w-aae0754573b8/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-aae0754573b8/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-aae0754573b8/certificate.json b/evidence/final/wiring/tasks/w-aae0754573b8/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..d7b6497d756d5829031a0c3e40e5d81733d29717 --- /dev/null +++ b/evidence/final/wiring/tasks/w-aae0754573b8/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-aae0754573b8", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000042 + }, + "spec_hash": "sha256:85749e5b5f9845f4496eae283b95e625c43d7f2011edd7ca5060b1eeae03ac72", + "image_sha256": "2000f9852d3ef2318da4f88226b6aaa0b7c0181905bffa21edcbfd94061f4a0a", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 8, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000042, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5, + 6, + 7 + ], + [ + 2, + 0, + 1, + 3, + 4, + 5, + 6, + 7 + ], + [ + 3, + 1, + 0, + 2, + 5, + 4, + 7, + 6 + ], + [ + 2, + 1, + 0, + 3, + 6, + 4, + 7, + 5 + ], + [ + 1, + 2, + 0, + 3, + 7, + 5, + 6, + 4 + ], + [ + 2, + 1, + 0, + 3, + 6, + 4, + 7, + 5 + ], + [ + 1, + 2, + 0, + 3, + 6, + 5, + 7, + 4 + ], + [ + 0, + 3, + 1, + 2, + 6, + 5, + 7, + 4 + ], + [ + 0, + 3, + 2, + 1, + 7, + 4, + 6, + 5 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-aae0754573b8/task.json b/evidence/final/wiring/tasks/w-aae0754573b8/task.json new file mode 100644 index 0000000000000000000000000000000000000000..99afc4d3daa61ae463802055be5643014d5ed4eb --- /dev/null +++ b/evidence/final/wiring/tasks/w-aae0754573b8/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-aae0754573b8", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b32fe9ed05ee/answer.json b/evidence/final/wiring/tasks/w-b32fe9ed05ee/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..6768ff6c53a4e672438d926736038beb3fa240ca --- /dev/null +++ b/evidence/final/wiring/tasks/w-b32fe9ed05ee/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R3", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b32fe9ed05ee/certificate.json b/evidence/final/wiring/tasks/w-b32fe9ed05ee/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..77aac59b9e91d4693c24014f79879e3d2dc51a93 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b32fe9ed05ee/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-b32fe9ed05ee", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L6 -> R3" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000037 + }, + "spec_hash": "sha256:e6ab39d260dd028a04a18592b67b08d97456502cf2de1659da4c2dd60b70b4cc", + "image_sha256": "ce0bffaab1238785b117186a80d21aa439e9757dddd88f4c40d072060e36edec", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R3 vs R3" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 9, + "crossings_on_query_wire": 4 + }, + "targets": [], + "spec": { + "seed": 20261208000037, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 1, + 0, + 2, + 3, + 5, + 4, + 7, + 6 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5, + 7, + 6 + ], + [ + 0, + 2, + 4, + 1, + 3, + 5, + 6, + 7 + ], + [ + 1, + 3, + 5, + 0, + 2, + 4, + 7, + 6 + ], + [ + 2, + 4, + 5, + 0, + 1, + 3, + 7, + 6 + ], + [ + 2, + 5, + 4, + 1, + 0, + 3, + 6, + 7 + ], + [ + 3, + 4, + 5, + 0, + 1, + 2, + 6, + 7 + ], + [ + 3, + 5, + 4, + 0, + 2, + 1, + 7, + 6 + ], + [ + 4, + 5, + 3, + 0, + 1, + 2, + 6, + 7 + ] + ], + "query": 5, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b32fe9ed05ee/image.png b/evidence/final/wiring/tasks/w-b32fe9ed05ee/image.png new file mode 100644 index 0000000000000000000000000000000000000000..73c525ef66990011b9e68cd092ed61a438922a38 Binary files /dev/null and b/evidence/final/wiring/tasks/w-b32fe9ed05ee/image.png differ diff --git a/evidence/final/wiring/tasks/w-b32fe9ed05ee/task.json b/evidence/final/wiring/tasks/w-b32fe9ed05ee/task.json new file mode 100644 index 0000000000000000000000000000000000000000..ec11cd6d02a4342aa66efb695b61c7e4828f1e6a --- /dev/null +++ b/evidence/final/wiring/tasks/w-b32fe9ed05ee/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-b32fe9ed05ee", + "image": "image.png", + "question": "Follow the wire that starts at terminal L6. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b45e8ef097e5/answer.json b/evidence/final/wiring/tasks/w-b45e8ef097e5/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b45e8ef097e5/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b45e8ef097e5/certificate.json b/evidence/final/wiring/tasks/w-b45e8ef097e5/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..eeb38b6edef5f40f316e0d33389a5cf6283e8a24 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b45e8ef097e5/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-b45e8ef097e5", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000057 + }, + "spec_hash": "sha256:5ab70d54aae069a2d0a4dc4d5fbfc5ecfc14ffbd3c3337766cbf83e03f64b171", + "image_sha256": "9ceb35d5079def03adf99fa3597b5a8ee747c0403294c0b3d5aed398f44e742e", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 11, + "crossings_on_query_wire": 2 + }, + "targets": [], + "spec": { + "seed": 20261208000057, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5, + 6, + 7 + ], + [ + 0, + 1, + 4, + 2, + 3, + 6, + 5, + 7 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5, + 6, + 7 + ], + [ + 0, + 1, + 2, + 3, + 5, + 4, + 6, + 7 + ], + [ + 0, + 2, + 1, + 4, + 6, + 3, + 5, + 7 + ], + [ + 0, + 3, + 1, + 5, + 7, + 2, + 4, + 6 + ], + [ + 1, + 3, + 0, + 4, + 7, + 2, + 5, + 6 + ], + [ + 1, + 2, + 0, + 4, + 7, + 3, + 6, + 5 + ], + [ + 2, + 1, + 0, + 3, + 6, + 4, + 7, + 5 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b45e8ef097e5/image.png b/evidence/final/wiring/tasks/w-b45e8ef097e5/image.png new file mode 100644 index 0000000000000000000000000000000000000000..ac0477df27eed96074ccd935921234f125426a6e Binary files /dev/null and b/evidence/final/wiring/tasks/w-b45e8ef097e5/image.png differ diff --git a/evidence/final/wiring/tasks/w-b45e8ef097e5/task.json b/evidence/final/wiring/tasks/w-b45e8ef097e5/task.json new file mode 100644 index 0000000000000000000000000000000000000000..c21ef38c83a4544a4cc417cae05eed89bf84ae48 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b45e8ef097e5/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-b45e8ef097e5", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b4a3583d77f1/answer.json b/evidence/final/wiring/tasks/w-b4a3583d77f1/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b4a3583d77f1/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b4a3583d77f1/certificate.json b/evidence/final/wiring/tasks/w-b4a3583d77f1/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..38d372b7d9ccade1f7c9d69a7a8b58459a4bf7ec --- /dev/null +++ b/evidence/final/wiring/tasks/w-b4a3583d77f1/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-b4a3583d77f1", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L7 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000075 + }, + "spec_hash": "sha256:70acf662ffa7560a766e74f23ffe4cf7d4d73c69c079a02dc97e3a7c19dd2ab9", + "image_sha256": "2c8c12ba83d84afbbfe95fda4ae960fdc0f606737c1591368c158aecb4956512", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 26, + "crossings_on_query_wire": 1 + }, + "targets": [], + "spec": { + "seed": 20261208000075, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 3, + 2, + 4, + 6, + 5, + 7, + 8, + 10, + 9, + 11 + ], + [ + 2, + 0, + 3, + 1, + 5, + 7, + 4, + 6, + 8, + 9, + 10, + 11 + ], + [ + 2, + 1, + 4, + 0, + 5, + 6, + 3, + 7, + 8, + 10, + 9, + 11 + ], + [ + 3, + 1, + 4, + 0, + 6, + 5, + 2, + 8, + 7, + 11, + 9, + 10 + ], + [ + 4, + 2, + 3, + 0, + 5, + 6, + 1, + 8, + 7, + 11, + 10, + 9 + ], + [ + 5, + 3, + 2, + 1, + 4, + 6, + 0, + 9, + 7, + 10, + 11, + 8 + ], + [ + 5, + 2, + 3, + 0, + 4, + 7, + 1, + 8, + 6, + 11, + 10, + 9 + ], + [ + 5, + 3, + 2, + 1, + 4, + 6, + 0, + 8, + 7, + 11, + 9, + 10 + ], + [ + 4, + 3, + 2, + 0, + 5, + 7, + 1, + 8, + 6, + 11, + 10, + 9 + ], + [ + 3, + 4, + 1, + 0, + 6, + 7, + 2, + 8, + 5, + 11, + 10, + 9 + ], + [ + 4, + 3, + 2, + 0, + 5, + 8, + 1, + 7, + 6, + 11, + 9, + 10 + ], + [ + 4, + 2, + 3, + 1, + 5, + 7, + 0, + 8, + 6, + 11, + 10, + 9 + ], + [ + 4, + 3, + 2, + 0, + 6, + 8, + 1, + 7, + 5, + 11, + 9, + 10 + ], + [ + 5, + 2, + 3, + 1, + 6, + 8, + 0, + 7, + 4, + 11, + 9, + 10 + ], + [ + 5, + 1, + 4, + 2, + 6, + 7, + 0, + 8, + 3, + 11, + 10, + 9 + ] + ], + "query": 6, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b4a3583d77f1/task.json b/evidence/final/wiring/tasks/w-b4a3583d77f1/task.json new file mode 100644 index 0000000000000000000000000000000000000000..c6e1dcc2f26effd2ed48981cf374f9eea5e1cc99 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b4a3583d77f1/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-b4a3583d77f1", + "image": "image.png", + "question": "Follow the wire that starts at terminal L7. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b6d47eed00d3/answer.json b/evidence/final/wiring/tasks/w-b6d47eed00d3/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..da2884c83250e57d3e92be71061db586007d0bd4 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b6d47eed00d3/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R10", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b6d47eed00d3/certificate.json b/evidence/final/wiring/tasks/w-b6d47eed00d3/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..5056c780f6e6f8a831b013d32e2c30859c980ce1 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b6d47eed00d3/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-b6d47eed00d3", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L9 -> R10" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000095 + }, + "spec_hash": "sha256:44e3686910d02ec92c0c39792187c2002200062eccfb92bf887f84ef7e0bbe11", + "image_sha256": "158e28a97ed59051f5667e2611d5daae0dfd4c16fe0950400909afce5fef7d1c", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R10 vs R10" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 55, + "crossings_on_query_wire": 9 + }, + "targets": [], + "spec": { + "seed": 20261208000095, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 0, + 2, + 1, + 4, + 3, + 6, + 5, + 7, + 9, + 8, + 10, + 11, + 13, + 12 + ], + [ + 1, + 2, + 0, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 11, + 10, + 12, + 13 + ], + [ + 0, + 3, + 1, + 2, + 5, + 4, + 7, + 6, + 9, + 8, + 10, + 11, + 12, + 13 + ], + [ + 1, + 2, + 0, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 12, + 11, + 13 + ], + [ + 2, + 1, + 0, + 4, + 3, + 5, + 6, + 8, + 7, + 9, + 10, + 13, + 11, + 12 + ], + [ + 2, + 0, + 1, + 4, + 3, + 5, + 7, + 8, + 6, + 9, + 11, + 12, + 10, + 13 + ], + [ + 3, + 1, + 0, + 5, + 2, + 4, + 6, + 8, + 7, + 9, + 12, + 11, + 10, + 13 + ], + [ + 4, + 0, + 1, + 6, + 2, + 3, + 5, + 7, + 8, + 9, + 11, + 12, + 10, + 13 + ], + [ + 3, + 0, + 2, + 6, + 1, + 4, + 5, + 7, + 9, + 8, + 12, + 11, + 10, + 13 + ], + [ + 3, + 1, + 2, + 5, + 0, + 4, + 6, + 7, + 10, + 8, + 12, + 11, + 9, + 13 + ], + [ + 4, + 0, + 2, + 6, + 1, + 3, + 5, + 7, + 11, + 9, + 12, + 10, + 8, + 13 + ], + [ + 3, + 0, + 1, + 5, + 2, + 4, + 6, + 8, + 11, + 10, + 12, + 9, + 7, + 13 + ], + [ + 2, + 1, + 0, + 4, + 3, + 5, + 6, + 8, + 11, + 9, + 12, + 10, + 7, + 13 + ], + [ + 1, + 2, + 0, + 4, + 3, + 6, + 5, + 7, + 10, + 9, + 12, + 11, + 8, + 13 + ], + [ + 0, + 3, + 1, + 5, + 2, + 6, + 4, + 8, + 10, + 9, + 11, + 12, + 7, + 13 + ], + [ + 1, + 2, + 0, + 4, + 3, + 7, + 5, + 9, + 10, + 8, + 11, + 12, + 6, + 13 + ], + [ + 0, + 3, + 1, + 5, + 2, + 7, + 4, + 10, + 9, + 8, + 12, + 11, + 6, + 13 + ], + [ + 0, + 4, + 2, + 6, + 1, + 8, + 3, + 11, + 9, + 7, + 12, + 10, + 5, + 13 + ], + [ + 0, + 4, + 2, + 5, + 1, + 7, + 3, + 10, + 9, + 8, + 13, + 11, + 6, + 12 + ] + ], + "query": 8, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b6d47eed00d3/task.json b/evidence/final/wiring/tasks/w-b6d47eed00d3/task.json new file mode 100644 index 0000000000000000000000000000000000000000..477e8199003f3e0df1593ecf3f22e63931ec8a96 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b6d47eed00d3/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-b6d47eed00d3", + "image": "image.png", + "question": "Follow the wire that starts at terminal L9. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b848456fc981/answer.json b/evidence/final/wiring/tasks/w-b848456fc981/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..4c11a3bcfe81542229b6755ffb5823f24f45e2f7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b848456fc981/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R6", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b848456fc981/certificate.json b/evidence/final/wiring/tasks/w-b848456fc981/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..c30f9bdd27ca0f13cde39ed0fdea282249f31664 --- /dev/null +++ b/evidence/final/wiring/tasks/w-b848456fc981/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-b848456fc981", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L7 -> R6" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000074 + }, + "spec_hash": "sha256:8e86def4effef3b6a124c3a1a7a1c0268be1abed05016f77b5d2710d93ed17f1", + "image_sha256": "4019a9554f88ff8096d555da2015b1d3cec1f48dfe4bc2bef0bec6eec233f468", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R6 vs R6" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 20, + "crossings_on_query_wire": 9 + }, + "targets": [], + "spec": { + "seed": 20261208000074, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 0, + 2, + 1, + 3, + 4, + 6, + 5, + 7, + 8, + 10, + 9, + 11 + ], + [ + 1, + 3, + 0, + 2, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 0, + 3, + 1, + 2, + 5, + 4, + 7, + 6, + 9, + 8, + 11, + 10 + ], + [ + 1, + 2, + 0, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 11, + 10 + ], + [ + 0, + 3, + 1, + 2, + 4, + 5, + 6, + 7, + 8, + 10, + 11, + 9 + ], + [ + 0, + 3, + 2, + 1, + 5, + 4, + 7, + 6, + 8, + 11, + 10, + 9 + ], + [ + 1, + 2, + 3, + 0, + 6, + 4, + 8, + 5, + 7, + 11, + 9, + 10 + ], + [ + 2, + 1, + 4, + 0, + 5, + 3, + 7, + 6, + 8, + 11, + 10, + 9 + ], + [ + 2, + 0, + 3, + 1, + 5, + 4, + 7, + 6, + 9, + 11, + 10, + 8 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5, + 6, + 7, + 8, + 10, + 11, + 9 + ], + [ + 0, + 1, + 4, + 2, + 3, + 6, + 5, + 7, + 9, + 11, + 10, + 8 + ], + [ + 1, + 0, + 5, + 3, + 2, + 6, + 4, + 7, + 8, + 10, + 11, + 9 + ], + [ + 0, + 1, + 4, + 2, + 3, + 7, + 5, + 6, + 8, + 9, + 11, + 10 + ], + [ + 1, + 0, + 5, + 3, + 2, + 6, + 4, + 7, + 9, + 8, + 11, + 10 + ], + [ + 0, + 1, + 4, + 2, + 3, + 7, + 5, + 6, + 8, + 9, + 11, + 10 + ] + ], + "query": 6, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-b848456fc981/task.json b/evidence/final/wiring/tasks/w-b848456fc981/task.json new file mode 100644 index 0000000000000000000000000000000000000000..f680148795c051b273277fc72b2d33f8f69ebc6b --- /dev/null +++ b/evidence/final/wiring/tasks/w-b848456fc981/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-b848456fc981", + "image": "image.png", + "question": "Follow the wire that starts at terminal L7. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-ba764d65bb4e/answer.json b/evidence/final/wiring/tasks/w-ba764d65bb4e/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-ba764d65bb4e/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-ba764d65bb4e/certificate.json b/evidence/final/wiring/tasks/w-ba764d65bb4e/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..dff0915958d1fffea7cff85a4a482a9c0fe85096 --- /dev/null +++ b/evidence/final/wiring/tasks/w-ba764d65bb4e/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-ba764d65bb4e", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L2 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000002 + }, + "spec_hash": "sha256:19deca1529ed4fa1e6a2ee55b09a53f4cf4d0637f1e5e88f7baeae85ba5da060", + "image_sha256": "ccf428f5867f28f9c3af222dbb3367ec21f8cf984b8c03218cae4eabca056a7f", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 180.0 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 0, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000002, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 1, + 0, + 2, + 3 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 1, + 0, + 3, + 2 + ] + ], + "query": 1, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-ba764d65bb4e/task.json b/evidence/final/wiring/tasks/w-ba764d65bb4e/task.json new file mode 100644 index 0000000000000000000000000000000000000000..6b1ee3d2bbedaff15eea078058d7090187676226 --- /dev/null +++ b/evidence/final/wiring/tasks/w-ba764d65bb4e/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-ba764d65bb4e", + "image": "image.png", + "question": "Follow the wire that starts at terminal L2. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c57f629a3f99/answer.json b/evidence/final/wiring/tasks/w-c57f629a3f99/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-c57f629a3f99/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c57f629a3f99/certificate.json b/evidence/final/wiring/tasks/w-c57f629a3f99/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..e9579db114b3563a072f519e790477f1248155bb --- /dev/null +++ b/evidence/final/wiring/tasks/w-c57f629a3f99/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-c57f629a3f99", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000065 + }, + "spec_hash": "sha256:298e2dbeb6a81daf07dc925f89e3ec80a53ef2a0b3b969ed07c6b5835a2ee387", + "image_sha256": "211045aaf0f59e6b588e7d6f007b25d3589a23818e21384e030bf9de697f2b57", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 24, + "crossings_on_query_wire": 6 + }, + "targets": [], + "spec": { + "seed": 20261208000065, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 1, + 0, + 2, + 4, + 3, + 6, + 5, + 8, + 7, + 9 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 1, + 3, + 2, + 4, + 6, + 5, + 7, + 8, + 9 + ], + [ + 1, + 0, + 4, + 2, + 3, + 7, + 5, + 6, + 8, + 9 + ], + [ + 0, + 1, + 4, + 3, + 2, + 7, + 6, + 5, + 9, + 8 + ], + [ + 0, + 2, + 3, + 4, + 1, + 8, + 6, + 5, + 9, + 7 + ], + [ + 0, + 3, + 2, + 4, + 1, + 7, + 5, + 6, + 9, + 8 + ], + [ + 1, + 4, + 2, + 3, + 0, + 7, + 6, + 5, + 8, + 9 + ], + [ + 1, + 5, + 3, + 2, + 0, + 8, + 6, + 4, + 7, + 9 + ], + [ + 0, + 6, + 2, + 3, + 1, + 7, + 5, + 4, + 8, + 9 + ], + [ + 0, + 6, + 3, + 2, + 1, + 7, + 5, + 4, + 9, + 8 + ], + [ + 1, + 7, + 2, + 3, + 0, + 6, + 4, + 5, + 9, + 8 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c57f629a3f99/task.json b/evidence/final/wiring/tasks/w-c57f629a3f99/task.json new file mode 100644 index 0000000000000000000000000000000000000000..0c38c0bfa7d6657e6d02c7b9a30effb385706409 --- /dev/null +++ b/evidence/final/wiring/tasks/w-c57f629a3f99/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-c57f629a3f99", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c6b92e9d2823/answer.json b/evidence/final/wiring/tasks/w-c6b92e9d2823/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..e98a68233c3cf25d44dc02c1d9d172d9b8f4c4ba --- /dev/null +++ b/evidence/final/wiring/tasks/w-c6b92e9d2823/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R9", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c6b92e9d2823/certificate.json b/evidence/final/wiring/tasks/w-c6b92e9d2823/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..8f6ebdcfa81ef37c6db29b53d47a3b1f31e701c9 --- /dev/null +++ b/evidence/final/wiring/tasks/w-c6b92e9d2823/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-c6b92e9d2823", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L6 -> R9" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000086 + }, + "spec_hash": "sha256:e7dd9b70d37b50fd8c8f0035676c7c06d3c2c4ca3fdf3b22ad97f549bd457b8e", + "image_sha256": "d547a163f60f62a0af4b9c15a13bdb1cec8469e1758674f1c13785b79933048a", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R9 vs R9" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 18, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000086, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5, + 7, + 6, + 9, + 8, + 11, + 10 + ], + [ + 2, + 0, + 4, + 1, + 3, + 6, + 7, + 5, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5, + 7, + 6, + 9, + 8, + 11, + 10 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 8, + 6, + 9, + 7, + 11, + 10 + ], + [ + 0, + 2, + 1, + 4, + 3, + 5, + 9, + 7, + 8, + 6, + 10, + 11 + ], + [ + 1, + 3, + 0, + 4, + 2, + 5, + 8, + 7, + 9, + 6, + 11, + 10 + ], + [ + 0, + 2, + 1, + 5, + 3, + 4, + 8, + 6, + 9, + 7, + 10, + 11 + ], + [ + 1, + 2, + 0, + 4, + 3, + 5, + 7, + 6, + 10, + 8, + 9, + 11 + ], + [ + 0, + 3, + 1, + 4, + 2, + 5, + 6, + 7, + 10, + 9, + 8, + 11 + ], + [ + 1, + 2, + 0, + 4, + 3, + 6, + 5, + 8, + 9, + 10, + 7, + 11 + ], + [ + 1, + 3, + 0, + 5, + 2, + 7, + 4, + 8, + 9, + 10, + 6, + 11 + ], + [ + 0, + 2, + 1, + 4, + 3, + 7, + 5, + 9, + 8, + 11, + 6, + 10 + ], + [ + 1, + 3, + 0, + 4, + 2, + 7, + 6, + 8, + 9, + 10, + 5, + 11 + ], + [ + 2, + 3, + 0, + 4, + 1, + 8, + 5, + 7, + 10, + 9, + 6, + 11 + ], + [ + 2, + 4, + 1, + 3, + 0, + 8, + 6, + 7, + 11, + 9, + 5, + 10 + ] + ], + "query": 5, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c6b92e9d2823/image.png b/evidence/final/wiring/tasks/w-c6b92e9d2823/image.png new file mode 100644 index 0000000000000000000000000000000000000000..dcc9cdb33ff297f2e4b7824f529ec18ede5c7b00 Binary files /dev/null and b/evidence/final/wiring/tasks/w-c6b92e9d2823/image.png differ diff --git a/evidence/final/wiring/tasks/w-c6b92e9d2823/task.json b/evidence/final/wiring/tasks/w-c6b92e9d2823/task.json new file mode 100644 index 0000000000000000000000000000000000000000..8592770274c625f73777cc30351f19f43b21538f --- /dev/null +++ b/evidence/final/wiring/tasks/w-c6b92e9d2823/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-c6b92e9d2823", + "image": "image.png", + "question": "Follow the wire that starts at terminal L6. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c83d2d510d2f/answer.json b/evidence/final/wiring/tasks/w-c83d2d510d2f/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-c83d2d510d2f/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c83d2d510d2f/certificate.json b/evidence/final/wiring/tasks/w-c83d2d510d2f/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..75f05902ef7ef88826ebeafc3dca8e86f96c9f77 --- /dev/null +++ b/evidence/final/wiring/tasks/w-c83d2d510d2f/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-c83d2d510d2f", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000005 + }, + "spec_hash": "sha256:a883a1e718e7965012bd5d61b5ea6e1a9f788d4df81f220d5fe7e78cb3039917", + "image_sha256": "ac4658ad8867cb6867fd567b447f0c28bf4417ef73120692a15209a140b3d4a2", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 2, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000005, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 2, + 1, + 3 + ], + [ + 1, + 2, + 0, + 3 + ], + [ + 2, + 1, + 0, + 3 + ], + [ + 2, + 0, + 1, + 3 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c83d2d510d2f/task.json b/evidence/final/wiring/tasks/w-c83d2d510d2f/task.json new file mode 100644 index 0000000000000000000000000000000000000000..809da79d938e4332c0e6da2c7a4628dd30402487 --- /dev/null +++ b/evidence/final/wiring/tasks/w-c83d2d510d2f/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-c83d2d510d2f", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c8a7bf8406c9/answer.json b/evidence/final/wiring/tasks/w-c8a7bf8406c9/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..ec4da124135255fe43f94566ae57673e9d94e0d5 --- /dev/null +++ b/evidence/final/wiring/tasks/w-c8a7bf8406c9/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R8", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c8a7bf8406c9/certificate.json b/evidence/final/wiring/tasks/w-c8a7bf8406c9/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..4999209f35c747da498e244d4a29961de10a8ae8 --- /dev/null +++ b/evidence/final/wiring/tasks/w-c8a7bf8406c9/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-c8a7bf8406c9", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L8 -> R8" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000066 + }, + "spec_hash": "sha256:95fe5dcf15b4dd528c75e40506aa47ca68ffb9e2a7223356f973c65f8e739fb1", + "image_sha256": "6206fedba3724a7c6ac716619ea59a34adec98147340c4db4d769d3105a2adec", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R8 vs R8" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 24, + "crossings_on_query_wire": 6 + }, + "targets": [], + "spec": { + "seed": 20261208000066, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5, + 7, + 6, + 9, + 8 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 7, + 6, + 8, + 9 + ], + [ + 0, + 1, + 3, + 2, + 6, + 4, + 8, + 5, + 7, + 9 + ], + [ + 0, + 1, + 2, + 3, + 6, + 4, + 9, + 5, + 7, + 8 + ], + [ + 0, + 2, + 1, + 4, + 5, + 3, + 9, + 6, + 8, + 7 + ], + [ + 0, + 1, + 2, + 3, + 6, + 4, + 8, + 5, + 9, + 7 + ], + [ + 1, + 0, + 3, + 2, + 7, + 5, + 8, + 4, + 9, + 6 + ], + [ + 0, + 1, + 2, + 3, + 6, + 4, + 9, + 5, + 8, + 7 + ], + [ + 1, + 0, + 2, + 3, + 6, + 5, + 8, + 4, + 9, + 7 + ], + [ + 2, + 0, + 1, + 3, + 6, + 4, + 7, + 5, + 9, + 8 + ], + [ + 3, + 1, + 0, + 2, + 5, + 4, + 7, + 6, + 8, + 9 + ], + [ + 2, + 0, + 1, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ] + ], + "query": 7, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c8a7bf8406c9/task.json b/evidence/final/wiring/tasks/w-c8a7bf8406c9/task.json new file mode 100644 index 0000000000000000000000000000000000000000..a4ecd577569c12682284a1e8ec5123c0ea981d3d --- /dev/null +++ b/evidence/final/wiring/tasks/w-c8a7bf8406c9/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-c8a7bf8406c9", + "image": "image.png", + "question": "Follow the wire that starts at terminal L8. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c93510fe7b2d/answer.json b/evidence/final/wiring/tasks/w-c93510fe7b2d/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-c93510fe7b2d/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c93510fe7b2d/certificate.json b/evidence/final/wiring/tasks/w-c93510fe7b2d/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..b0a2e4f9f45ff39555f0f9dae37553c5ec893d87 --- /dev/null +++ b/evidence/final/wiring/tasks/w-c93510fe7b2d/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-c93510fe7b2d", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000056 + }, + "spec_hash": "sha256:5233c87bc5bc917bfa54cff6c8f35681e3409a6198baf0d3240edc2d86d0d77f", + "image_sha256": "b5cb8769b746ddda91b83251b4367ab1b2687c1cc8bed67886727a9d7ac5793f", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 10, + "crossings_on_query_wire": 4 + }, + "targets": [], + "spec": { + "seed": 20261208000056, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 0, + 1, + 2, + 4, + 3, + 5, + 6, + 7 + ], + [ + 0, + 2, + 1, + 4, + 3, + 5, + 6, + 7 + ], + [ + 1, + 3, + 0, + 4, + 2, + 5, + 7, + 6 + ], + [ + 2, + 4, + 0, + 3, + 1, + 6, + 7, + 5 + ], + [ + 3, + 4, + 1, + 2, + 0, + 5, + 7, + 6 + ], + [ + 4, + 3, + 0, + 2, + 1, + 6, + 7, + 5 + ], + [ + 4, + 2, + 1, + 3, + 0, + 6, + 7, + 5 + ], + [ + 3, + 2, + 0, + 4, + 1, + 5, + 7, + 6 + ], + [ + 4, + 2, + 1, + 3, + 0, + 6, + 7, + 5 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-c93510fe7b2d/task.json b/evidence/final/wiring/tasks/w-c93510fe7b2d/task.json new file mode 100644 index 0000000000000000000000000000000000000000..4ce8305945c722063d6e027dd8b39e721d0aeaf0 --- /dev/null +++ b/evidence/final/wiring/tasks/w-c93510fe7b2d/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-c93510fe7b2d", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d820f79f36d1/answer.json b/evidence/final/wiring/tasks/w-d820f79f36d1/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-d820f79f36d1/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d820f79f36d1/certificate.json b/evidence/final/wiring/tasks/w-d820f79f36d1/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..cc1586b8ac3dffbc8aec6fa2ca2a55ac1f648087 --- /dev/null +++ b/evidence/final/wiring/tasks/w-d820f79f36d1/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-d820f79f36d1", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000106 + }, + "spec_hash": "sha256:59f1a9c7926aa6e90eef59d1967245730c0fd70ee1d7dd4282bfbe03fe7f3233", + "image_sha256": "40b04d695dc6366ad5b73feaf2e1d89df2530caa8ea00d6a51a2560cd3d998da", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 55, + "crossings_on_query_wire": 14 + }, + "targets": [], + "spec": { + "seed": 20261208000106, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 7, + 6, + 8, + 9, + 11, + 10, + 12, + 13 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5, + 6, + 7, + 9, + 8, + 12, + 10, + 11, + 13 + ], + [ + 0, + 1, + 2, + 4, + 3, + 6, + 5, + 7, + 10, + 8, + 11, + 9, + 12, + 13 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5, + 6, + 7, + 11, + 9, + 10, + 8, + 12, + 13 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 5, + 8, + 11, + 10, + 9, + 7, + 13, + 12 + ], + [ + 1, + 0, + 2, + 3, + 5, + 6, + 4, + 9, + 12, + 10, + 8, + 7, + 13, + 11 + ], + [ + 0, + 1, + 3, + 2, + 6, + 5, + 4, + 10, + 11, + 9, + 7, + 8, + 13, + 12 + ], + [ + 0, + 2, + 4, + 1, + 7, + 5, + 3, + 11, + 10, + 8, + 6, + 9, + 13, + 12 + ], + [ + 1, + 3, + 5, + 0, + 6, + 4, + 2, + 10, + 11, + 9, + 7, + 8, + 13, + 12 + ], + [ + 1, + 4, + 5, + 0, + 7, + 3, + 2, + 9, + 11, + 10, + 6, + 8, + 13, + 12 + ], + [ + 0, + 3, + 5, + 1, + 8, + 4, + 2, + 10, + 12, + 9, + 6, + 7, + 13, + 11 + ], + [ + 0, + 4, + 5, + 2, + 8, + 3, + 1, + 11, + 12, + 9, + 7, + 6, + 13, + 10 + ], + [ + 0, + 5, + 4, + 2, + 8, + 3, + 1, + 11, + 12, + 10, + 6, + 7, + 13, + 9 + ], + [ + 1, + 4, + 5, + 3, + 7, + 2, + 0, + 10, + 13, + 11, + 6, + 8, + 12, + 9 + ], + [ + 0, + 5, + 4, + 2, + 6, + 3, + 1, + 11, + 13, + 10, + 7, + 9, + 12, + 8 + ], + [ + 1, + 4, + 5, + 2, + 6, + 3, + 0, + 10, + 12, + 11, + 7, + 9, + 13, + 8 + ], + [ + 0, + 5, + 4, + 3, + 7, + 2, + 1, + 11, + 13, + 10, + 6, + 8, + 12, + 9 + ], + [ + 1, + 4, + 5, + 3, + 8, + 2, + 0, + 10, + 12, + 11, + 6, + 7, + 13, + 9 + ], + [ + 0, + 3, + 6, + 4, + 7, + 2, + 1, + 11, + 13, + 10, + 5, + 8, + 12, + 9 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d820f79f36d1/task.json b/evidence/final/wiring/tasks/w-d820f79f36d1/task.json new file mode 100644 index 0000000000000000000000000000000000000000..6541dbf00a0bd932291af885836f0f63fc63ad7c --- /dev/null +++ b/evidence/final/wiring/tasks/w-d820f79f36d1/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-d820f79f36d1", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d89b315f7567/answer.json b/evidence/final/wiring/tasks/w-d89b315f7567/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..3f4a6ac11bd354537e4570fe6b4c6c0de119541d --- /dev/null +++ b/evidence/final/wiring/tasks/w-d89b315f7567/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R11", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d89b315f7567/certificate.json b/evidence/final/wiring/tasks/w-d89b315f7567/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..7313a816d953f673383f160088e45893430b2d26 --- /dev/null +++ b/evidence/final/wiring/tasks/w-d89b315f7567/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-d89b315f7567", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L8 -> R11" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000101 + }, + "spec_hash": "sha256:69aafd4814f37a5a86ae894dac0539f3677aa3ee738c9c70f41059f167569d71", + "image_sha256": "d31d95ff778a47d590991b36e7b01073aced037a971d29b78f1a5f495f6a5f8b", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R11 vs R11" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 55, + "crossings_on_query_wire": 8 + }, + "targets": [], + "spec": { + "seed": 20261208000101, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 6, + 7, + 9, + 8, + 10, + 12, + 11, + 13 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5, + 7, + 6, + 10, + 8, + 9, + 13, + 11, + 12 + ], + [ + 0, + 2, + 4, + 1, + 3, + 5, + 6, + 7, + 9, + 8, + 10, + 13, + 12, + 11 + ], + [ + 0, + 2, + 3, + 1, + 4, + 6, + 5, + 8, + 9, + 7, + 10, + 12, + 13, + 11 + ], + [ + 1, + 3, + 2, + 0, + 5, + 6, + 4, + 7, + 10, + 8, + 9, + 11, + 13, + 12 + ], + [ + 0, + 2, + 3, + 1, + 4, + 6, + 5, + 8, + 9, + 7, + 10, + 12, + 13, + 11 + ], + [ + 1, + 2, + 3, + 0, + 4, + 5, + 6, + 7, + 10, + 8, + 9, + 12, + 13, + 11 + ], + [ + 0, + 2, + 3, + 1, + 5, + 4, + 6, + 8, + 9, + 7, + 10, + 11, + 13, + 12 + ], + [ + 1, + 3, + 2, + 0, + 5, + 4, + 7, + 9, + 8, + 6, + 10, + 11, + 13, + 12 + ], + [ + 2, + 4, + 1, + 0, + 6, + 3, + 7, + 9, + 8, + 5, + 11, + 10, + 12, + 13 + ], + [ + 1, + 3, + 2, + 0, + 5, + 4, + 8, + 10, + 7, + 6, + 11, + 9, + 12, + 13 + ], + [ + 0, + 2, + 3, + 1, + 4, + 5, + 9, + 11, + 6, + 7, + 10, + 8, + 13, + 12 + ], + [ + 0, + 1, + 4, + 2, + 3, + 6, + 9, + 11, + 5, + 8, + 10, + 7, + 12, + 13 + ], + [ + 0, + 1, + 5, + 2, + 3, + 6, + 10, + 12, + 4, + 7, + 9, + 8, + 11, + 13 + ], + [ + 1, + 0, + 4, + 3, + 2, + 6, + 11, + 12, + 5, + 7, + 8, + 9, + 10, + 13 + ], + [ + 0, + 1, + 4, + 3, + 2, + 5, + 10, + 13, + 6, + 7, + 9, + 8, + 11, + 12 + ], + [ + 1, + 0, + 4, + 2, + 3, + 6, + 11, + 12, + 5, + 8, + 9, + 7, + 10, + 13 + ], + [ + 2, + 0, + 4, + 1, + 3, + 5, + 12, + 11, + 6, + 8, + 10, + 7, + 9, + 13 + ], + [ + 2, + 1, + 5, + 0, + 3, + 4, + 13, + 10, + 6, + 9, + 11, + 7, + 8, + 12 + ] + ], + "query": 7, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d89b315f7567/task.json b/evidence/final/wiring/tasks/w-d89b315f7567/task.json new file mode 100644 index 0000000000000000000000000000000000000000..51ffd11e66f271b4dc60cc7baad474e1d9748a4f --- /dev/null +++ b/evidence/final/wiring/tasks/w-d89b315f7567/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-d89b315f7567", + "image": "image.png", + "question": "Follow the wire that starts at terminal L8. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d9f12b0e42ef/answer.json b/evidence/final/wiring/tasks/w-d9f12b0e42ef/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..6768ff6c53a4e672438d926736038beb3fa240ca --- /dev/null +++ b/evidence/final/wiring/tasks/w-d9f12b0e42ef/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R3", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d9f12b0e42ef/certificate.json b/evidence/final/wiring/tasks/w-d9f12b0e42ef/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..fc75ee725fdc85d3b282f7f36b9dcc66dc924577 --- /dev/null +++ b/evidence/final/wiring/tasks/w-d9f12b0e42ef/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-d9f12b0e42ef", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R3" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000001 + }, + "spec_hash": "sha256:0e1bb2bcb58da0cb5065a2081faefebd89e49b27b9d74ca5d22c174d0dccedcd", + "image_sha256": "4ab5d0ee9cfc58d54ba11e2d768d2d5d64416ecb12f3b5774492730a4fbef013", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R3 vs R3" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 1, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000001, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 1, + 0, + 2, + 3 + ], + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 2, + 1, + 3 + ], + [ + 1, + 3, + 0, + 2 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-d9f12b0e42ef/task.json b/evidence/final/wiring/tasks/w-d9f12b0e42ef/task.json new file mode 100644 index 0000000000000000000000000000000000000000..8be1effa8111ce5ea69b9960d5d28f9b6cb8b1a3 --- /dev/null +++ b/evidence/final/wiring/tasks/w-d9f12b0e42ef/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-d9f12b0e42ef", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-da9022510300/answer.json b/evidence/final/wiring/tasks/w-da9022510300/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..2efe02e3e39caa3851a34c8e74193c81a049e9a4 --- /dev/null +++ b/evidence/final/wiring/tasks/w-da9022510300/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R12", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-da9022510300/certificate.json b/evidence/final/wiring/tasks/w-da9022510300/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..28185f4b6d16a35573d49d851eb1e7dc5a60c342 --- /dev/null +++ b/evidence/final/wiring/tasks/w-da9022510300/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-da9022510300", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L11 -> R12" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000102 + }, + "spec_hash": "sha256:1199c5c99cbb83fff98337bd1db046dc53c1750c4bfcf93022c795a0cc782973", + "image_sha256": "8fb7ed2f06654c67cb039f3da258a92c14f9ff75e836b4d6dea79673b441bdad", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R12 vs R12" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 57, + "crossings_on_query_wire": 7 + }, + "targets": [], + "spec": { + "seed": 20261208000102, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 3, + 2, + 4, + 6, + 5, + 7, + 9, + 8, + 11, + 10, + 13, + 12 + ], + [ + 0, + 1, + 2, + 3, + 4, + 7, + 5, + 6, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 3, + 2, + 5, + 6, + 4, + 7, + 9, + 8, + 11, + 10, + 13, + 12 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 5, + 8, + 10, + 7, + 11, + 9, + 13, + 12 + ], + [ + 1, + 0, + 3, + 2, + 5, + 7, + 4, + 8, + 10, + 6, + 12, + 9, + 13, + 11 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 5, + 8, + 10, + 7, + 13, + 9, + 12, + 11 + ], + [ + 1, + 0, + 3, + 2, + 5, + 7, + 4, + 9, + 11, + 6, + 13, + 8, + 12, + 10 + ], + [ + 1, + 0, + 4, + 2, + 6, + 7, + 3, + 8, + 10, + 5, + 13, + 9, + 12, + 11 + ], + [ + 0, + 1, + 5, + 3, + 6, + 7, + 2, + 9, + 11, + 4, + 13, + 8, + 12, + 10 + ], + [ + 0, + 2, + 4, + 3, + 7, + 6, + 1, + 10, + 11, + 5, + 12, + 8, + 13, + 9 + ], + [ + 1, + 2, + 3, + 4, + 6, + 7, + 0, + 11, + 10, + 5, + 13, + 9, + 12, + 8 + ], + [ + 2, + 1, + 4, + 3, + 5, + 8, + 0, + 11, + 10, + 6, + 12, + 9, + 13, + 7 + ], + [ + 1, + 2, + 3, + 4, + 5, + 9, + 0, + 12, + 10, + 6, + 11, + 8, + 13, + 7 + ], + [ + 0, + 3, + 2, + 5, + 4, + 8, + 1, + 12, + 11, + 7, + 10, + 9, + 13, + 6 + ], + [ + 0, + 3, + 1, + 5, + 4, + 9, + 2, + 13, + 10, + 6, + 11, + 8, + 12, + 7 + ], + [ + 1, + 2, + 0, + 4, + 5, + 8, + 3, + 13, + 11, + 7, + 10, + 9, + 12, + 6 + ], + [ + 1, + 2, + 0, + 3, + 5, + 7, + 4, + 13, + 12, + 8, + 9, + 10, + 11, + 6 + ], + [ + 0, + 3, + 1, + 2, + 4, + 7, + 5, + 13, + 12, + 8, + 10, + 9, + 11, + 6 + ], + [ + 1, + 4, + 0, + 2, + 3, + 7, + 6, + 13, + 12, + 9, + 11, + 8, + 10, + 5 + ] + ], + "query": 10, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-da9022510300/task.json b/evidence/final/wiring/tasks/w-da9022510300/task.json new file mode 100644 index 0000000000000000000000000000000000000000..bf1e1f066593584ea9626fc56e763b4155ac074a --- /dev/null +++ b/evidence/final/wiring/tasks/w-da9022510300/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-da9022510300", + "image": "image.png", + "question": "Follow the wire that starts at terminal L11. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-dbafe69316c0/answer.json b/evidence/final/wiring/tasks/w-dbafe69316c0/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..4c11a3bcfe81542229b6755ffb5823f24f45e2f7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-dbafe69316c0/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R6", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-dbafe69316c0/certificate.json b/evidence/final/wiring/tasks/w-dbafe69316c0/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..85a1cec90b410e334f45a38e7677c0ef7f8d61fd --- /dev/null +++ b/evidence/final/wiring/tasks/w-dbafe69316c0/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-dbafe69316c0", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R6" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000088 + }, + "spec_hash": "sha256:700f10afb004fb0a757659e0cee235dd4cce9f060583bdef17552ce783c2a353", + "image_sha256": "c28f4bb151401cf8357fdabc26cd53abff4e37e8b2fa5bd1c75030b0361eae3f", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R6 vs R6" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 27, + "crossings_on_query_wire": 6 + }, + "targets": [], + "spec": { + "seed": 20261208000088, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 7, + 6, + 9, + 8, + 10, + 11 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 7, + 6, + 8, + 10, + 9, + 11 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 6, + 7, + 9, + 10, + 8, + 11 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 7, + 6, + 8, + 11, + 9, + 10 + ], + [ + 0, + 2, + 1, + 4, + 3, + 6, + 8, + 5, + 7, + 11, + 10, + 9 + ], + [ + 0, + 3, + 1, + 5, + 2, + 6, + 9, + 4, + 7, + 10, + 11, + 8 + ], + [ + 0, + 4, + 2, + 6, + 1, + 5, + 9, + 3, + 8, + 11, + 10, + 7 + ], + [ + 0, + 3, + 1, + 5, + 2, + 6, + 10, + 4, + 7, + 11, + 9, + 8 + ], + [ + 1, + 2, + 0, + 6, + 3, + 5, + 9, + 4, + 7, + 11, + 10, + 8 + ], + [ + 1, + 3, + 0, + 5, + 2, + 6, + 8, + 4, + 7, + 10, + 11, + 9 + ], + [ + 1, + 2, + 0, + 6, + 3, + 5, + 7, + 4, + 8, + 9, + 11, + 10 + ], + [ + 0, + 2, + 1, + 5, + 4, + 6, + 8, + 3, + 7, + 10, + 11, + 9 + ], + [ + 1, + 3, + 0, + 4, + 5, + 7, + 8, + 2, + 6, + 9, + 11, + 10 + ], + [ + 0, + 2, + 1, + 5, + 4, + 6, + 8, + 3, + 7, + 10, + 11, + 9 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-dbafe69316c0/task.json b/evidence/final/wiring/tasks/w-dbafe69316c0/task.json new file mode 100644 index 0000000000000000000000000000000000000000..b8757dc9f5bd8bc4d54e3d5261aad6099b63d968 --- /dev/null +++ b/evidence/final/wiring/tasks/w-dbafe69316c0/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-dbafe69316c0", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-de96ad52965e/answer.json b/evidence/final/wiring/tasks/w-de96ad52965e/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..4c11a3bcfe81542229b6755ffb5823f24f45e2f7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-de96ad52965e/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R6", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-de96ad52965e/certificate.json b/evidence/final/wiring/tasks/w-de96ad52965e/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..87521d6a2157c625d99702197ae10af76af9d62c --- /dev/null +++ b/evidence/final/wiring/tasks/w-de96ad52965e/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-de96ad52965e", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R6" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000049 + }, + "spec_hash": "sha256:7ad6805851250dac1b1921659807b1a71213a32f83960e940e686e680e2252fb", + "image_sha256": "7e156d012a8e77cf426b87df4ed2cc1a2c1929681c924a06dda69a1a462ee591", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R6 vs R6" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 10, + "crossings_on_query_wire": 4 + }, + "targets": [], + "spec": { + "seed": 20261208000049, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 0, + 1, + 3, + 2, + 5, + 4, + 7, + 6 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5, + 7, + 6 + ], + [ + 0, + 1, + 3, + 2, + 5, + 4, + 7, + 6 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 2, + 0, + 1, + 4, + 3, + 6, + 5, + 7 + ], + [ + 2, + 1, + 0, + 5, + 3, + 7, + 4, + 6 + ], + [ + 3, + 1, + 0, + 4, + 2, + 7, + 5, + 6 + ], + [ + 3, + 1, + 0, + 4, + 2, + 7, + 6, + 5 + ], + [ + 2, + 1, + 0, + 5, + 3, + 7, + 6, + 4 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-de96ad52965e/image.png b/evidence/final/wiring/tasks/w-de96ad52965e/image.png new file mode 100644 index 0000000000000000000000000000000000000000..cdf8f1b31e3b901e1a855b0f14ef2eb698941a1f Binary files /dev/null and b/evidence/final/wiring/tasks/w-de96ad52965e/image.png differ diff --git a/evidence/final/wiring/tasks/w-de96ad52965e/task.json b/evidence/final/wiring/tasks/w-de96ad52965e/task.json new file mode 100644 index 0000000000000000000000000000000000000000..2d6d658b02c6f23f7a55bd519948b67b808bc022 --- /dev/null +++ b/evidence/final/wiring/tasks/w-de96ad52965e/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-de96ad52965e", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e23077b92a43/answer.json b/evidence/final/wiring/tasks/w-e23077b92a43/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..8b7db7237e6cbef20519d43d0979ad4e6a0c6284 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e23077b92a43/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R7", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e23077b92a43/certificate.json b/evidence/final/wiring/tasks/w-e23077b92a43/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..5f66506ca98b784bde4021919f9b51d465eb4987 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e23077b92a43/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-e23077b92a43", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L8 -> R7" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000040 + }, + "spec_hash": "sha256:3dd792f7d2aa0cb512367054fefbdf7cd96c1cadfae46e88e8a046de2aa86cf9", + "image_sha256": "cdc28062fd66442ed18ebd0bb9557176823b7187d3c1430d99e7e18d49638400", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R7 vs R7" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 8, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000040, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 7, + 6 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5, + 7, + 6 + ], + [ + 0, + 1, + 3, + 2, + 5, + 4, + 7, + 6 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5, + 7, + 6 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 0, + 1, + 2, + 4, + 3, + 5, + 7, + 6 + ], + [ + 0, + 2, + 1, + 3, + 4, + 5, + 7, + 6 + ], + [ + 1, + 2, + 0, + 3, + 5, + 4, + 7, + 6 + ], + [ + 2, + 1, + 0, + 4, + 5, + 3, + 7, + 6 + ] + ], + "query": 7, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e23077b92a43/task.json b/evidence/final/wiring/tasks/w-e23077b92a43/task.json new file mode 100644 index 0000000000000000000000000000000000000000..5c0460eec9588a88025c2f703a8976b10e73a78e --- /dev/null +++ b/evidence/final/wiring/tasks/w-e23077b92a43/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-e23077b92a43", + "image": "image.png", + "question": "Follow the wire that starts at terminal L8. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e2d9b64d8553/answer.json b/evidence/final/wiring/tasks/w-e2d9b64d8553/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-e2d9b64d8553/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e2d9b64d8553/certificate.json b/evidence/final/wiring/tasks/w-e2d9b64d8553/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..c4cf079e17e5803ca5b1edf924e8b9d7b75f43d8 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e2d9b64d8553/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-e2d9b64d8553", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000004 + }, + "spec_hash": "sha256:c34ad99eeac727cc89ec2d2e90653f0251e705f89d67b9f9f6d5c4ecd4e26246", + "image_sha256": "d32ca904e9a24c297dcfa7069894c2ee3f13257a10b500e8b3677b1856f7135d", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 180.0 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 0, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000004, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 1, + 0, + 3, + 2 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 1, + 0, + 3, + 2 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e2d9b64d8553/task.json b/evidence/final/wiring/tasks/w-e2d9b64d8553/task.json new file mode 100644 index 0000000000000000000000000000000000000000..349a0fa75d1aec66875e4cb1c00676e9548d312a --- /dev/null +++ b/evidence/final/wiring/tasks/w-e2d9b64d8553/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-e2d9b64d8553", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e39ed600a8fd/answer.json b/evidence/final/wiring/tasks/w-e39ed600a8fd/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e39ed600a8fd/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e39ed600a8fd/certificate.json b/evidence/final/wiring/tasks/w-e39ed600a8fd/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..42e413e831c3feac79541955565bea6df5851085 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e39ed600a8fd/certificate.json @@ -0,0 +1,85 @@ +{ + "task_id": "w-e39ed600a8fd", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000016 + }, + "spec_hash": "sha256:be7acc3299cbd6e13b46fc97a6193e6b9f1c265c6fc4f71591658566459e4445", + "image_sha256": "572338258f83754487cb3731a566ade21af93f5d4bbe0f9e6cfda9cb468fa521", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 1, + "n_wires": 4, + "shuffle_cols": 3, + "max_jump": 1, + "crossings_total": 1, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000016, + "n": 4, + "cols": 3, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3 + ], + [ + 1, + 0, + 2, + 3 + ], + [ + 0, + 1, + 2, + 3 + ], + [ + 0, + 1, + 3, + 2 + ], + [ + 0, + 2, + 3, + 1 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e39ed600a8fd/image.png b/evidence/final/wiring/tasks/w-e39ed600a8fd/image.png new file mode 100644 index 0000000000000000000000000000000000000000..d19528a1fd422ac080f418c8521272932974f1eb Binary files /dev/null and b/evidence/final/wiring/tasks/w-e39ed600a8fd/image.png differ diff --git a/evidence/final/wiring/tasks/w-e39ed600a8fd/task.json b/evidence/final/wiring/tasks/w-e39ed600a8fd/task.json new file mode 100644 index 0000000000000000000000000000000000000000..90491336dcfc2aec330b6752607ab16ad9ce39fe --- /dev/null +++ b/evidence/final/wiring/tasks/w-e39ed600a8fd/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-e39ed600a8fd", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e41728697e2f/answer.json b/evidence/final/wiring/tasks/w-e41728697e2f/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..6768ff6c53a4e672438d926736038beb3fa240ca --- /dev/null +++ b/evidence/final/wiring/tasks/w-e41728697e2f/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R3", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e41728697e2f/certificate.json b/evidence/final/wiring/tasks/w-e41728697e2f/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..bddca0fa101f66be29a9f129c76ef27b0fb9aedc --- /dev/null +++ b/evidence/final/wiring/tasks/w-e41728697e2f/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-e41728697e2f", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R3" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000069 + }, + "spec_hash": "sha256:bb13fe65dc73b587788fac4f3e777eca44cfcc4e3681a7269c3a3a567a467602", + "image_sha256": "6eeb3e93e9b5c2666ce6cb6210621c169c7eba73fc1cd9e912758b35ed049706", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R3 vs R3" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 26, + "crossings_on_query_wire": 8 + }, + "targets": [], + "spec": { + "seed": 20261208000069, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 1, + 0, + 2, + 3, + 5, + 4, + 7, + 6, + 8, + 9 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 6, + 7, + 9, + 8 + ], + [ + 0, + 1, + 2, + 3, + 6, + 4, + 5, + 8, + 9, + 7 + ], + [ + 1, + 0, + 2, + 3, + 6, + 5, + 4, + 9, + 8, + 7 + ], + [ + 0, + 1, + 3, + 2, + 7, + 5, + 4, + 8, + 9, + 6 + ], + [ + 1, + 0, + 2, + 3, + 7, + 5, + 4, + 8, + 9, + 6 + ], + [ + 2, + 0, + 1, + 4, + 8, + 6, + 3, + 7, + 9, + 5 + ], + [ + 2, + 1, + 0, + 4, + 7, + 5, + 3, + 8, + 9, + 6 + ], + [ + 2, + 0, + 1, + 5, + 6, + 4, + 3, + 9, + 8, + 7 + ], + [ + 3, + 0, + 1, + 6, + 5, + 4, + 2, + 9, + 8, + 7 + ], + [ + 2, + 1, + 0, + 7, + 5, + 4, + 3, + 8, + 9, + 6 + ], + [ + 2, + 0, + 1, + 7, + 6, + 3, + 4, + 9, + 8, + 5 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e41728697e2f/image.png b/evidence/final/wiring/tasks/w-e41728697e2f/image.png new file mode 100644 index 0000000000000000000000000000000000000000..2ccb22acad759a0371f49bdcae268c999025e532 Binary files /dev/null and b/evidence/final/wiring/tasks/w-e41728697e2f/image.png differ diff --git a/evidence/final/wiring/tasks/w-e41728697e2f/task.json b/evidence/final/wiring/tasks/w-e41728697e2f/task.json new file mode 100644 index 0000000000000000000000000000000000000000..6f4953deaa286d6b096322776c617dbe0b40a8d7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e41728697e2f/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-e41728697e2f", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e450d61adcf6/answer.json b/evidence/final/wiring/tasks/w-e450d61adcf6/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e450d61adcf6/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e450d61adcf6/certificate.json b/evidence/final/wiring/tasks/w-e450d61adcf6/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..77f30e9535a3567306e5602d4816e9df72f4fb4f --- /dev/null +++ b/evidence/final/wiring/tasks/w-e450d61adcf6/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-e450d61adcf6", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000029 + }, + "spec_hash": "sha256:0bdc930c13923ab1d51a3ac731adf319ffadd923093f5f9ffafedcfb8ce436e1", + "image_sha256": "4da52922545b1f210ffc35afe6896c412034962287dcfbe9408f9414beccf723", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 11, + "crossings_on_query_wire": 4 + }, + "targets": [], + "spec": { + "seed": 20261208000029, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5 + ], + [ + 0, + 1, + 4, + 2, + 3, + 5 + ], + [ + 0, + 1, + 5, + 2, + 3, + 4 + ], + [ + 1, + 0, + 4, + 3, + 2, + 5 + ], + [ + 0, + 1, + 4, + 2, + 3, + 5 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e450d61adcf6/task.json b/evidence/final/wiring/tasks/w-e450d61adcf6/task.json new file mode 100644 index 0000000000000000000000000000000000000000..bca20f329fe567588ebf4e796aeb3dcecb5b1fb9 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e450d61adcf6/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-e450d61adcf6", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e760bfc65958/answer.json b/evidence/final/wiring/tasks/w-e760bfc65958/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-e760bfc65958/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e760bfc65958/certificate.json b/evidence/final/wiring/tasks/w-e760bfc65958/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..84543fc0c253515aac59e784e1b168b0086eebed --- /dev/null +++ b/evidence/final/wiring/tasks/w-e760bfc65958/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-e760bfc65958", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L14 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000105 + }, + "spec_hash": "sha256:838c87a48be19702f6f79d476ed61d42814d227155180e3fb076b814a7d4328a", + "image_sha256": "7aafc10ce923285f56b9c34dd9bd40bd1a767dbfbedfc259d3d782957eddf885", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 60, + "crossings_on_query_wire": 9 + }, + "targets": [], + "spec": { + "seed": 20261208000105, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 0, + 2, + 1, + 4, + 3, + 6, + 5, + 8, + 7, + 9, + 11, + 10, + 13, + 12 + ], + [ + 1, + 3, + 0, + 4, + 2, + 7, + 5, + 8, + 6, + 10, + 11, + 9, + 13, + 12 + ], + [ + 0, + 2, + 1, + 5, + 3, + 8, + 4, + 7, + 6, + 10, + 12, + 9, + 13, + 11 + ], + [ + 1, + 3, + 0, + 4, + 2, + 8, + 5, + 6, + 7, + 9, + 13, + 10, + 12, + 11 + ], + [ + 0, + 2, + 1, + 5, + 3, + 9, + 4, + 7, + 6, + 8, + 12, + 11, + 13, + 10 + ], + [ + 1, + 3, + 0, + 4, + 2, + 10, + 5, + 8, + 6, + 7, + 11, + 12, + 13, + 9 + ], + [ + 1, + 3, + 0, + 4, + 2, + 11, + 6, + 9, + 5, + 7, + 10, + 12, + 13, + 8 + ], + [ + 0, + 2, + 1, + 5, + 3, + 10, + 7, + 9, + 4, + 6, + 11, + 12, + 13, + 8 + ], + [ + 1, + 3, + 0, + 4, + 2, + 10, + 7, + 8, + 5, + 6, + 12, + 11, + 13, + 9 + ], + [ + 2, + 3, + 0, + 5, + 1, + 11, + 6, + 9, + 4, + 7, + 12, + 10, + 13, + 8 + ], + [ + 2, + 4, + 1, + 6, + 0, + 12, + 5, + 9, + 3, + 8, + 11, + 10, + 13, + 7 + ], + [ + 2, + 5, + 1, + 6, + 0, + 13, + 4, + 9, + 3, + 7, + 10, + 11, + 12, + 8 + ], + [ + 2, + 4, + 0, + 6, + 1, + 12, + 5, + 9, + 3, + 8, + 11, + 10, + 13, + 7 + ], + [ + 2, + 5, + 1, + 7, + 0, + 12, + 4, + 8, + 3, + 9, + 10, + 11, + 13, + 6 + ], + [ + 1, + 6, + 2, + 8, + 0, + 11, + 3, + 7, + 4, + 9, + 10, + 12, + 13, + 5 + ], + [ + 0, + 7, + 3, + 9, + 1, + 10, + 2, + 6, + 5, + 8, + 11, + 13, + 12, + 4 + ], + [ + 0, + 6, + 3, + 8, + 2, + 11, + 1, + 7, + 5, + 9, + 10, + 13, + 12, + 4 + ], + [ + 1, + 6, + 3, + 7, + 2, + 11, + 0, + 8, + 5, + 9, + 10, + 12, + 13, + 4 + ], + [ + 2, + 5, + 4, + 8, + 1, + 10, + 0, + 7, + 6, + 9, + 11, + 13, + 12, + 3 + ] + ], + "query": 13, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e760bfc65958/task.json b/evidence/final/wiring/tasks/w-e760bfc65958/task.json new file mode 100644 index 0000000000000000000000000000000000000000..b072af64b1150d0f71314137baad28cc5a056a20 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e760bfc65958/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-e760bfc65958", + "image": "image.png", + "question": "Follow the wire that starts at terminal L14. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e97e086ba652/answer.json b/evidence/final/wiring/tasks/w-e97e086ba652/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..6768ff6c53a4e672438d926736038beb3fa240ca --- /dev/null +++ b/evidence/final/wiring/tasks/w-e97e086ba652/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R3", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e97e086ba652/certificate.json b/evidence/final/wiring/tasks/w-e97e086ba652/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..8b17639a2e80f6837c2068f62087e9295bc2ea8a --- /dev/null +++ b/evidence/final/wiring/tasks/w-e97e086ba652/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-e97e086ba652", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L6 -> R3" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000100 + }, + "spec_hash": "sha256:994ed7440c7b295856eb1380e4ce25bdca8611e7ef57d9e59c51f28f3320f679", + "image_sha256": "383eae6f2e3eae627d97b618f08a8099ea9cc7f165d9700bceb7f862fd39e34e", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R3 vs R3" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 51, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000100, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 1, + 0, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 10, + 9, + 11, + 13, + 12 + ], + [ + 2, + 0, + 1, + 3, + 4, + 5, + 6, + 8, + 7, + 11, + 9, + 10, + 13, + 12 + ], + [ + 3, + 1, + 0, + 2, + 4, + 5, + 7, + 8, + 6, + 12, + 9, + 10, + 13, + 11 + ], + [ + 3, + 0, + 1, + 2, + 5, + 4, + 7, + 8, + 6, + 13, + 9, + 11, + 12, + 10 + ], + [ + 2, + 1, + 0, + 3, + 6, + 4, + 8, + 7, + 5, + 12, + 10, + 11, + 13, + 9 + ], + [ + 3, + 0, + 1, + 2, + 7, + 4, + 9, + 6, + 5, + 13, + 11, + 10, + 12, + 8 + ], + [ + 3, + 0, + 2, + 1, + 8, + 5, + 10, + 6, + 4, + 13, + 12, + 9, + 11, + 7 + ], + [ + 3, + 0, + 2, + 1, + 9, + 4, + 11, + 6, + 5, + 12, + 13, + 8, + 10, + 7 + ], + [ + 3, + 1, + 2, + 0, + 8, + 5, + 10, + 7, + 4, + 12, + 13, + 9, + 11, + 6 + ], + [ + 2, + 0, + 3, + 1, + 7, + 5, + 9, + 8, + 4, + 11, + 13, + 10, + 12, + 6 + ], + [ + 3, + 1, + 2, + 0, + 6, + 4, + 8, + 9, + 5, + 10, + 12, + 11, + 13, + 7 + ], + [ + 4, + 2, + 1, + 0, + 7, + 3, + 9, + 8, + 5, + 10, + 11, + 12, + 13, + 6 + ], + [ + 3, + 2, + 1, + 0, + 8, + 4, + 9, + 7, + 6, + 11, + 10, + 12, + 13, + 5 + ], + [ + 2, + 3, + 0, + 1, + 9, + 4, + 8, + 7, + 6, + 12, + 10, + 11, + 13, + 5 + ], + [ + 2, + 4, + 1, + 0, + 10, + 3, + 7, + 8, + 6, + 11, + 9, + 12, + 13, + 5 + ], + [ + 1, + 3, + 2, + 0, + 10, + 4, + 8, + 7, + 5, + 12, + 9, + 11, + 13, + 6 + ], + [ + 0, + 2, + 3, + 1, + 9, + 4, + 7, + 8, + 6, + 12, + 10, + 11, + 13, + 5 + ], + [ + 1, + 2, + 4, + 0, + 9, + 3, + 8, + 7, + 5, + 13, + 10, + 11, + 12, + 6 + ], + [ + 0, + 3, + 4, + 1, + 10, + 2, + 7, + 8, + 6, + 12, + 9, + 11, + 13, + 5 + ] + ], + "query": 5, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-e97e086ba652/task.json b/evidence/final/wiring/tasks/w-e97e086ba652/task.json new file mode 100644 index 0000000000000000000000000000000000000000..27c589cfb51a83594790c55ff1d6e3a37acb2758 --- /dev/null +++ b/evidence/final/wiring/tasks/w-e97e086ba652/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-e97e086ba652", + "image": "image.png", + "question": "Follow the wire that starts at terminal L6. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f0b32b74384f/answer.json b/evidence/final/wiring/tasks/w-f0b32b74384f/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..269a7ea426ba2c5c3f50e8292d87378c1f7a5888 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f0b32b74384f/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R5", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f0b32b74384f/certificate.json b/evidence/final/wiring/tasks/w-f0b32b74384f/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..9a07553e92424543b476354ff3435a8ca5bc4ebc --- /dev/null +++ b/evidence/final/wiring/tasks/w-f0b32b74384f/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-f0b32b74384f", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L5 -> R5" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000062 + }, + "spec_hash": "sha256:584c516ae79451e6f661054108a53cc0d9d637cd367a04d182209812f83a0e0e", + "image_sha256": "569ad6efe1bc3eda46f91342daa2ba11ece9d5afea40737c02e69f00b7d58327", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R5 vs R5" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 25, + "crossings_on_query_wire": 6 + }, + "targets": [], + "spec": { + "seed": 20261208000062, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 2, + 1, + 3, + 5, + 4, + 6, + 7, + 9, + 8 + ], + [ + 0, + 2, + 1, + 3, + 6, + 4, + 5, + 7, + 9, + 8 + ], + [ + 1, + 2, + 0, + 4, + 5, + 3, + 6, + 8, + 9, + 7 + ], + [ + 0, + 2, + 1, + 5, + 4, + 3, + 7, + 9, + 8, + 6 + ], + [ + 0, + 1, + 2, + 6, + 3, + 4, + 7, + 9, + 8, + 5 + ], + [ + 1, + 0, + 3, + 7, + 2, + 5, + 6, + 9, + 8, + 4 + ], + [ + 0, + 1, + 2, + 6, + 3, + 4, + 7, + 9, + 8, + 5 + ], + [ + 1, + 0, + 3, + 7, + 2, + 5, + 6, + 9, + 8, + 4 + ], + [ + 0, + 1, + 2, + 6, + 3, + 4, + 7, + 8, + 9, + 5 + ], + [ + 1, + 0, + 2, + 5, + 4, + 3, + 7, + 9, + 8, + 6 + ], + [ + 1, + 0, + 2, + 6, + 3, + 4, + 7, + 8, + 9, + 5 + ], + [ + 2, + 0, + 1, + 7, + 4, + 3, + 6, + 8, + 9, + 5 + ] + ], + "query": 4, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f0b32b74384f/task.json b/evidence/final/wiring/tasks/w-f0b32b74384f/task.json new file mode 100644 index 0000000000000000000000000000000000000000..4fbb0e19c2f53d23a5a20d9e5e85e4f35868560e --- /dev/null +++ b/evidence/final/wiring/tasks/w-f0b32b74384f/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-f0b32b74384f", + "image": "image.png", + "question": "Follow the wire that starts at terminal L5. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f0cce68f6c5f/answer.json b/evidence/final/wiring/tasks/w-f0cce68f6c5f/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-f0cce68f6c5f/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f0cce68f6c5f/certificate.json b/evidence/final/wiring/tasks/w-f0cce68f6c5f/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..cdc0d2e1ca83fa424e854aa80c13bdcb7326be51 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f0cce68f6c5f/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-f0cce68f6c5f", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000071 + }, + "spec_hash": "sha256:dfa35a9bf77ad858d88cdd5e214083d390c6d04cda07b4db299f7a542ccd02c5", + "image_sha256": "ab651fd171c045e372538e0a4bae179ab4d133f1bdf20f71e0d4ebaeee7aa676", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 24, + "crossings_on_query_wire": 6 + }, + "targets": [], + "spec": { + "seed": 20261208000071, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 2, + 1, + 4, + 3, + 6, + 5, + 8, + 7, + 9 + ], + [ + 1, + 2, + 0, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 3, + 1, + 2, + 4, + 6, + 5, + 8, + 7, + 9 + ], + [ + 1, + 4, + 0, + 2, + 3, + 5, + 6, + 7, + 8, + 9 + ], + [ + 2, + 3, + 0, + 1, + 4, + 5, + 6, + 8, + 7, + 9 + ], + [ + 1, + 3, + 0, + 2, + 5, + 4, + 6, + 7, + 8, + 9 + ], + [ + 0, + 2, + 1, + 3, + 4, + 5, + 7, + 6, + 9, + 8 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 8, + 5, + 9, + 7 + ], + [ + 1, + 0, + 3, + 2, + 5, + 6, + 8, + 4, + 9, + 7 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 9, + 5, + 8, + 7 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5, + 9, + 6, + 7, + 8 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 9, + 5, + 8, + 7 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f0cce68f6c5f/task.json b/evidence/final/wiring/tasks/w-f0cce68f6c5f/task.json new file mode 100644 index 0000000000000000000000000000000000000000..f5b68efbe7ebdf9156bb1bf5b9f2d94a1b9a19aa --- /dev/null +++ b/evidence/final/wiring/tasks/w-f0cce68f6c5f/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-f0cce68f6c5f", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f2250007c608/answer.json b/evidence/final/wiring/tasks/w-f2250007c608/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f2250007c608/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f2250007c608/certificate.json b/evidence/final/wiring/tasks/w-f2250007c608/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..8f4c1ce211bbf6558daafd0b02eebd4283afd1a4 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f2250007c608/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-f2250007c608", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000045 + }, + "spec_hash": "sha256:aa9778f5801148b3b7a4a8a0be1ed7181d1b2062d3c146e02a500ec17f21f3a9", + "image_sha256": "b03fd171c7b14140e66a0726ed59187b8f0c83dabb7b1fef542373bd56b7be58", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 13, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000045, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 0, + 2, + 1, + 4, + 3, + 6, + 5, + 7 + ], + [ + 0, + 1, + 2, + 3, + 4, + 7, + 5, + 6 + ], + [ + 1, + 0, + 3, + 2, + 5, + 7, + 4, + 6 + ], + [ + 1, + 0, + 4, + 2, + 6, + 7, + 3, + 5 + ], + [ + 0, + 1, + 5, + 3, + 7, + 6, + 2, + 4 + ], + [ + 1, + 0, + 4, + 3, + 7, + 6, + 2, + 5 + ], + [ + 0, + 1, + 3, + 4, + 7, + 5, + 2, + 6 + ], + [ + 0, + 2, + 3, + 5, + 7, + 4, + 1, + 6 + ], + [ + 0, + 1, + 4, + 6, + 7, + 3, + 2, + 5 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f2250007c608/image.png b/evidence/final/wiring/tasks/w-f2250007c608/image.png new file mode 100644 index 0000000000000000000000000000000000000000..42b646e04bab67c5643d5035d54a528cece1a1b5 Binary files /dev/null and b/evidence/final/wiring/tasks/w-f2250007c608/image.png differ diff --git a/evidence/final/wiring/tasks/w-f2250007c608/task.json b/evidence/final/wiring/tasks/w-f2250007c608/task.json new file mode 100644 index 0000000000000000000000000000000000000000..84214b266e829e8375626066570707ae599a3f96 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f2250007c608/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-f2250007c608", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f35137864435/answer.json b/evidence/final/wiring/tasks/w-f35137864435/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-f35137864435/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f35137864435/certificate.json b/evidence/final/wiring/tasks/w-f35137864435/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..c01888fd31f104e7a0cc73aad33f1b0583947380 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f35137864435/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-f35137864435", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L2 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000019 + }, + "spec_hash": "sha256:62feb93afcc3df73282490b28a1041d4800c01676de9d7a908ce93518fd422c8", + "image_sha256": "69335b806d4d6e3cdc6c13a4fe7fbb1ef05f8e946f274ba38445688fc4b73634", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 7, + "crossings_on_query_wire": 3 + }, + "targets": [], + "spec": { + "seed": 20261208000019, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4 + ], + [ + 2, + 0, + 4, + 1, + 5, + 3 + ], + [ + 2, + 1, + 3, + 0, + 5, + 4 + ], + [ + 2, + 1, + 4, + 0, + 5, + 3 + ], + [ + 1, + 2, + 3, + 0, + 5, + 4 + ], + [ + 0, + 3, + 2, + 1, + 4, + 5 + ] + ], + "query": 1, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f35137864435/task.json b/evidence/final/wiring/tasks/w-f35137864435/task.json new file mode 100644 index 0000000000000000000000000000000000000000..2b106b7647f4f2120024921d398037dff274e98f --- /dev/null +++ b/evidence/final/wiring/tasks/w-f35137864435/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-f35137864435", + "image": "image.png", + "question": "Follow the wire that starts at terminal L2. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f6ea77c07341/answer.json b/evidence/final/wiring/tasks/w-f6ea77c07341/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..28f75d67b9324c8b3d5eecd459c3f27190c14899 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f6ea77c07341/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R1", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f6ea77c07341/certificate.json b/evidence/final/wiring/tasks/w-f6ea77c07341/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..a7d2415f7750c140282c3bf042fd58f460698197 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f6ea77c07341/certificate.json @@ -0,0 +1,279 @@ +{ + "task_id": "w-f6ea77c07341", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R1" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000082 + }, + "spec_hash": "sha256:c73a5f156528fe4d07b89c4c58b90e5ccfb6d5a34a8e2b3ff3d78182639c332d", + "image_sha256": "fabb2ee9aeb6e05857b065bbcd87a39de2d30c35b6cc897859241b7de1a2ad22", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 116.7 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R1 vs R1" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 5, + "n_wires": 12, + "shuffle_cols": 14, + "max_jump": 1, + "crossings_total": 25, + "crossings_on_query_wire": 0 + }, + "targets": [], + "spec": { + "seed": 20261208000082, + "n": 12, + "cols": 14, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 2, + 4, + 3, + 6, + 5, + 8, + 7, + 10, + 9, + 11 + ], + [ + 0, + 1, + 3, + 4, + 2, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + [ + 1, + 0, + 2, + 5, + 3, + 4, + 6, + 7, + 9, + 8, + 10, + 11 + ], + [ + 0, + 1, + 3, + 5, + 2, + 4, + 6, + 8, + 10, + 7, + 9, + 11 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5, + 7, + 8, + 10, + 6, + 9, + 11 + ], + [ + 0, + 1, + 2, + 3, + 4, + 6, + 8, + 7, + 9, + 5, + 10, + 11 + ], + [ + 1, + 0, + 3, + 2, + 5, + 7, + 8, + 6, + 10, + 4, + 9, + 11 + ], + [ + 0, + 1, + 4, + 2, + 6, + 7, + 9, + 5, + 10, + 3, + 8, + 11 + ], + [ + 0, + 2, + 3, + 1, + 5, + 7, + 9, + 6, + 11, + 4, + 8, + 10 + ], + [ + 1, + 3, + 2, + 0, + 4, + 6, + 8, + 7, + 11, + 5, + 9, + 10 + ], + [ + 1, + 2, + 3, + 0, + 5, + 7, + 9, + 6, + 10, + 4, + 8, + 11 + ], + [ + 0, + 2, + 3, + 1, + 6, + 8, + 9, + 5, + 11, + 4, + 7, + 10 + ], + [ + 1, + 3, + 2, + 0, + 7, + 9, + 8, + 4, + 10, + 5, + 6, + 11 + ], + [ + 2, + 3, + 1, + 0, + 6, + 8, + 9, + 5, + 10, + 4, + 7, + 11 + ], + [ + 3, + 2, + 0, + 1, + 5, + 7, + 10, + 6, + 9, + 4, + 8, + 11 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f6ea77c07341/task.json b/evidence/final/wiring/tasks/w-f6ea77c07341/task.json new file mode 100644 index 0000000000000000000000000000000000000000..9dc334c3ffbc43c0285ee16e8a23260ebabe6de1 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f6ea77c07341/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-f6ea77c07341", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f8b63a37ba8b/answer.json b/evidence/final/wiring/tasks/w-f8b63a37ba8b/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..b659208cd37bebefc60ed21db26b19afb8ec5f2b --- /dev/null +++ b/evidence/final/wiring/tasks/w-f8b63a37ba8b/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R4", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f8b63a37ba8b/certificate.json b/evidence/final/wiring/tasks/w-f8b63a37ba8b/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..6e001a530e76864d82d94c3e0caf63b0cc4917f7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f8b63a37ba8b/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-f8b63a37ba8b", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L1 -> R4" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000035 + }, + "spec_hash": "sha256:799d2e348c5c9d5b6e0dbc2d2994b4464c49662252e144927d98122bbec5e830", + "image_sha256": "c7c0d155f805015295084aa7a2610546d9795398fa1ec28a30371942a4943903", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R4 vs R4" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 7, + "crossings_on_query_wire": 2 + }, + "targets": [], + "spec": { + "seed": 20261208000035, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 3, + 2, + 4, + 5 + ], + [ + 1, + 0, + 2, + 3, + 5, + 4 + ], + [ + 2, + 0, + 1, + 4, + 5, + 3 + ], + [ + 3, + 1, + 0, + 4, + 5, + 2 + ], + [ + 4, + 2, + 0, + 3, + 5, + 1 + ], + [ + 3, + 2, + 1, + 4, + 5, + 0 + ] + ], + "query": 0, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-f8b63a37ba8b/task.json b/evidence/final/wiring/tasks/w-f8b63a37ba8b/task.json new file mode 100644 index 0000000000000000000000000000000000000000..d54944df672637dee916419ec14e7a356559df85 --- /dev/null +++ b/evidence/final/wiring/tasks/w-f8b63a37ba8b/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-f8b63a37ba8b", + "image": "image.png", + "question": "Follow the wire that starts at terminal L1. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-fe28728ce920/answer.json b/evidence/final/wiring/tasks/w-fe28728ce920/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-fe28728ce920/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-fe28728ce920/certificate.json b/evidence/final/wiring/tasks/w-fe28728ce920/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..d99af6d370d3794d03387e031e84a2b04dafeafd --- /dev/null +++ b/evidence/final/wiring/tasks/w-fe28728ce920/certificate.json @@ -0,0 +1,375 @@ +{ + "task_id": "w-fe28728ce920", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000104 + }, + "spec_hash": "sha256:52e158af6e3416bea5155293708684ba71053d615d175b6c8a9c441f37f2059a", + "image_sha256": "4a637a9e8fb8bcc24ff74f4698cc631c971538e37d6e362a78288953c701db63", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 120.2 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 6, + "n_wires": 14, + "shuffle_cols": 18, + "max_jump": 1, + "crossings_total": 56, + "crossings_on_query_wire": 11 + }, + "targets": [], + "spec": { + "seed": 20261208000104, + "n": 14, + "cols": 18, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 0, + 2, + 1, + 3, + 5, + 4, + 6, + 7, + 9, + 8, + 10, + 12, + 11, + 13 + ], + [ + 1, + 3, + 0, + 2, + 6, + 4, + 5, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + [ + 0, + 2, + 1, + 3, + 7, + 5, + 4, + 6, + 9, + 8, + 11, + 10, + 13, + 12 + ], + [ + 0, + 3, + 1, + 2, + 8, + 4, + 5, + 6, + 10, + 7, + 11, + 9, + 12, + 13 + ], + [ + 1, + 3, + 0, + 2, + 9, + 5, + 4, + 7, + 10, + 6, + 12, + 8, + 11, + 13 + ], + [ + 0, + 3, + 1, + 2, + 10, + 4, + 5, + 8, + 9, + 6, + 13, + 7, + 11, + 12 + ], + [ + 0, + 4, + 2, + 1, + 10, + 3, + 5, + 7, + 9, + 6, + 13, + 8, + 12, + 11 + ], + [ + 1, + 4, + 3, + 0, + 10, + 2, + 6, + 8, + 9, + 5, + 13, + 7, + 11, + 12 + ], + [ + 2, + 3, + 4, + 0, + 11, + 1, + 7, + 9, + 8, + 5, + 13, + 6, + 10, + 12 + ], + [ + 3, + 2, + 4, + 1, + 10, + 0, + 8, + 9, + 7, + 6, + 12, + 5, + 11, + 13 + ], + [ + 2, + 3, + 4, + 0, + 11, + 1, + 7, + 9, + 8, + 5, + 12, + 6, + 10, + 13 + ], + [ + 2, + 3, + 5, + 1, + 11, + 0, + 6, + 10, + 8, + 4, + 13, + 7, + 9, + 12 + ], + [ + 3, + 2, + 4, + 0, + 12, + 1, + 6, + 9, + 7, + 5, + 13, + 8, + 10, + 11 + ], + [ + 4, + 1, + 3, + 0, + 12, + 2, + 5, + 9, + 8, + 6, + 13, + 7, + 11, + 10 + ], + [ + 4, + 0, + 2, + 1, + 11, + 3, + 5, + 10, + 7, + 6, + 13, + 8, + 12, + 9 + ], + [ + 3, + 0, + 1, + 2, + 12, + 4, + 6, + 9, + 8, + 5, + 13, + 7, + 11, + 10 + ], + [ + 2, + 1, + 0, + 3, + 13, + 4, + 5, + 9, + 7, + 6, + 12, + 8, + 10, + 11 + ], + [ + 3, + 0, + 1, + 2, + 13, + 5, + 4, + 9, + 8, + 6, + 11, + 7, + 10, + 12 + ], + [ + 4, + 0, + 1, + 2, + 13, + 5, + 3, + 10, + 7, + 6, + 12, + 8, + 9, + 11 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-fe28728ce920/task.json b/evidence/final/wiring/tasks/w-fe28728ce920/task.json new file mode 100644 index 0000000000000000000000000000000000000000..f2f043d4e7a6c1e1bd4c1be43ee9dff2088acb18 --- /dev/null +++ b/evidence/final/wiring/tasks/w-fe28728ce920/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-fe28728ce920", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-fe8f95b66ff4/answer.json b/evidence/final/wiring/tasks/w-fe8f95b66ff4/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..269a7ea426ba2c5c3f50e8292d87378c1f7a5888 --- /dev/null +++ b/evidence/final/wiring/tasks/w-fe8f95b66ff4/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R5", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-fe8f95b66ff4/certificate.json b/evidence/final/wiring/tasks/w-fe8f95b66ff4/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..b9a270f91bf31c6726998b9e6f06d28680748363 --- /dev/null +++ b/evidence/final/wiring/tasks/w-fe8f95b66ff4/certificate.json @@ -0,0 +1,155 @@ +{ + "task_id": "w-fe8f95b66ff4", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L3 -> R5" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000039 + }, + "spec_hash": "sha256:4c5a7349783637dba073a97bd121ae842594fd0c986b8fdad6c59d7fd3696cbc", + "image_sha256": "f38909f4ecf606e5a9fc8f40b7321ea9efde9b100ecd280752386cc70012e404", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 113.6 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R5 vs R5" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 3, + "n_wires": 8, + "shuffle_cols": 8, + "max_jump": 1, + "crossings_total": 9, + "crossings_on_query_wire": 5 + }, + "targets": [], + "spec": { + "seed": 20261208000039, + "n": 8, + "cols": 8, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + [ + 1, + 0, + 3, + 2, + 5, + 4, + 6, + 7 + ], + [ + 2, + 0, + 4, + 1, + 6, + 3, + 5, + 7 + ], + [ + 3, + 0, + 5, + 1, + 6, + 2, + 4, + 7 + ], + [ + 3, + 0, + 5, + 2, + 7, + 1, + 4, + 6 + ], + [ + 3, + 0, + 4, + 1, + 7, + 2, + 5, + 6 + ], + [ + 3, + 1, + 4, + 0, + 7, + 2, + 6, + 5 + ], + [ + 3, + 2, + 5, + 0, + 7, + 1, + 6, + 4 + ], + [ + 4, + 2, + 5, + 1, + 6, + 0, + 7, + 3 + ], + [ + 5, + 2, + 4, + 0, + 6, + 1, + 7, + 3 + ] + ], + "query": 2, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-fe8f95b66ff4/task.json b/evidence/final/wiring/tasks/w-fe8f95b66ff4/task.json new file mode 100644 index 0000000000000000000000000000000000000000..ae4fd8e728a6e3907104c1a039ed0687eabdebb7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-fe8f95b66ff4/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-fe8f95b66ff4", + "image": "image.png", + "question": "Follow the wire that starts at terminal L3. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-feb0ba4f9055/answer.json b/evidence/final/wiring/tasks/w-feb0ba4f9055/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..7b68991007d938908005d86e42581a1768ce9e1c --- /dev/null +++ b/evidence/final/wiring/tasks/w-feb0ba4f9055/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R2", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-feb0ba4f9055/certificate.json b/evidence/final/wiring/tasks/w-feb0ba4f9055/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..18451020e6a654bd8078c87956ba82086939e68d --- /dev/null +++ b/evidence/final/wiring/tasks/w-feb0ba4f9055/certificate.json @@ -0,0 +1,111 @@ +{ + "task_id": "w-feb0ba4f9055", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L4 -> R2" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000027 + }, + "spec_hash": "sha256:afeab9070ca1ac59505319260450db864be1df96775ab2e0e4f5c3231f5c9d27", + "image_sha256": "38f080a2bd541fa84e78f22c5ca1e958f9396aeb4edfe62cfef9a265a1892e16", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 109.9 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R2 vs R2" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": false, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 2, + "n_wires": 6, + "shuffle_cols": 5, + "max_jump": 1, + "crossings_total": 4, + "crossings_on_query_wire": 1 + }, + "targets": [], + "spec": { + "seed": 20261208000027, + "n": 6, + "cols": 5, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 1, + 0, + 2, + 4, + 3, + 5 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + [ + 0, + 1, + 3, + 2, + 5, + 4 + ], + [ + 0, + 2, + 4, + 1, + 5, + 3 + ], + [ + 0, + 1, + 4, + 2, + 5, + 3 + ], + [ + 0, + 2, + 3, + 1, + 5, + 4 + ] + ], + "query": 3, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-feb0ba4f9055/image.png b/evidence/final/wiring/tasks/w-feb0ba4f9055/image.png new file mode 100644 index 0000000000000000000000000000000000000000..216a233a2cfa936448d3fa5f81219334677533a5 Binary files /dev/null and b/evidence/final/wiring/tasks/w-feb0ba4f9055/image.png differ diff --git a/evidence/final/wiring/tasks/w-feb0ba4f9055/task.json b/evidence/final/wiring/tasks/w-feb0ba4f9055/task.json new file mode 100644 index 0000000000000000000000000000000000000000..0fb303f61ef66e249e4daef0bd17cffa84e97d7b --- /dev/null +++ b/evidence/final/wiring/tasks/w-feb0ba4f9055/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-feb0ba4f9055", + "image": "image.png", + "question": "Follow the wire that starts at terminal L4. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-feb252d6f57c/answer.json b/evidence/final/wiring/tasks/w-feb252d6f57c/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..8b7db7237e6cbef20519d43d0979ad4e6a0c6284 --- /dev/null +++ b/evidence/final/wiring/tasks/w-feb252d6f57c/answer.json @@ -0,0 +1,6 @@ +{ + "answer": "R7", + "answer_type": "tag", + "tolerance": 0.0, + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-feb252d6f57c/certificate.json b/evidence/final/wiring/tasks/w-feb252d6f57c/certificate.json new file mode 100644 index 0000000000000000000000000000000000000000..b9709f1ac01662f2da00da0a0dd1134c2c9f07a7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-feb252d6f57c/certificate.json @@ -0,0 +1,211 @@ +{ + "task_id": "w-feb252d6f57c", + "op": "TRACE", + "family": "wiring", + "trace": [ + "follow L7 -> R7" + ], + "generator": { + "version": "0.2.0", + "seed": 20261208000059 + }, + "spec_hash": "sha256:0fe16106746e0e08aa07e572d4d31cf6aa5ddd9d6a9a599f9aba1bd02358c4fb", + "image_sha256": "c49a349a707ca367421d6680597e8ceadf3b51faa56871d4ebcb50a4ea59ee4c", + "gates": { + "W1_crossing_angle": { + "pass": true, + "detail": "min crossing 115.5 deg" + }, + "W2_image_tracer": { + "pass": true, + "detail": "tracer R7 vs R7" + }, + "W3_legibility": { + "pass": true, + "detail": "labels 16px bold, contrast > 10:1 (fixed design)" + }, + "W4_leak": { + "pass": true, + "detail": "no leak" + } + }, + "tracer_full_agreement": true, + "variation_signature": { + "op": "TRACE", + "family": "wiring", + "difficulty": 4, + "n_wires": 10, + "shuffle_cols": 11, + "max_jump": 1, + "crossings_total": 26, + "crossings_on_query_wire": 4 + }, + "targets": [], + "spec": { + "seed": 20261208000059, + "n": 10, + "cols": 11, + "jump": 1, + "slots": [ + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + [ + 0, + 1, + 3, + 2, + 4, + 5, + 6, + 8, + 7, + 9 + ], + [ + 1, + 0, + 2, + 3, + 5, + 4, + 7, + 9, + 6, + 8 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 7, + 9 + ], + [ + 1, + 0, + 3, + 2, + 4, + 6, + 5, + 7, + 8, + 9 + ], + [ + 0, + 1, + 2, + 3, + 5, + 6, + 4, + 8, + 7, + 9 + ], + [ + 0, + 2, + 1, + 3, + 6, + 5, + 4, + 9, + 7, + 8 + ], + [ + 0, + 1, + 2, + 3, + 5, + 6, + 4, + 8, + 7, + 9 + ], + [ + 1, + 0, + 3, + 2, + 4, + 6, + 5, + 7, + 8, + 9 + ], + [ + 0, + 1, + 2, + 3, + 5, + 7, + 4, + 6, + 8, + 9 + ], + [ + 1, + 0, + 3, + 2, + 4, + 8, + 5, + 6, + 7, + 9 + ], + [ + 2, + 0, + 4, + 1, + 3, + 8, + 5, + 7, + 6, + 9 + ], + [ + 1, + 0, + 3, + 2, + 4, + 7, + 6, + 8, + 5, + 9 + ] + ], + "query": 6, + "palette": "mono", + "stroke": 4 + } +} \ No newline at end of file diff --git a/evidence/final/wiring/tasks/w-feb252d6f57c/image.png b/evidence/final/wiring/tasks/w-feb252d6f57c/image.png new file mode 100644 index 0000000000000000000000000000000000000000..c6a11fa922a94d8429e812bd2a5f6d7e3962a42f Binary files /dev/null and b/evidence/final/wiring/tasks/w-feb252d6f57c/image.png differ diff --git a/evidence/final/wiring/tasks/w-feb252d6f57c/task.json b/evidence/final/wiring/tasks/w-feb252d6f57c/task.json new file mode 100644 index 0000000000000000000000000000000000000000..91c3b8359a9567342935c4504cf7db1b746762e7 --- /dev/null +++ b/evidence/final/wiring/tasks/w-feb252d6f57c/task.json @@ -0,0 +1,7 @@ +{ + "task_id": "w-feb252d6f57c", + "image": "image.png", + "question": "Follow the wire that starts at terminal L7. At which right-side terminal does it end? Answer with that terminal's label.", + "answer_type": "tag", + "unit": "" +} \ No newline at end of file diff --git a/evidence/final/wiring/wiring_metrics.json b/evidence/final/wiring/wiring_metrics.json new file mode 100644 index 0000000000000000000000000000000000000000..5051acea80b2f9697d2600a55b647a32cc1873a0 --- /dev/null +++ b/evidence/final/wiring/wiring_metrics.json @@ -0,0 +1,56 @@ +{ + "1": { + "n_wires": 4, + "cols": 3, + "jump": 1, + "accepted": 16, + "rejected": 0, + "rejections": {} + }, + "2": { + "n_wires": 6, + "cols": 5, + "jump": 1, + "accepted": 16, + "rejected": 3, + "rejections": { + "W2_image_tracer": 3 + } + }, + "3": { + "n_wires": 8, + "cols": 8, + "jump": 1, + "accepted": 16, + "rejected": 6, + "rejections": { + "W2_image_tracer": 6 + } + }, + "4": { + "n_wires": 10, + "cols": 11, + "jump": 1, + "accepted": 16, + "rejected": 0, + "rejections": {} + }, + "5": { + "n_wires": 12, + "cols": 14, + "jump": 1, + "accepted": 16, + "rejected": 0, + "rejections": {} + }, + "6": { + "n_wires": 14, + "cols": 18, + "jump": 1, + "accepted": 16, + "rejected": 1, + "rejections": { + "W2_image_tracer": 1 + } + } +} \ No newline at end of file diff --git a/needlepoint/__init__.py b/needlepoint/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8ca150ebfa0f10ed9bf4b5cfcbb02ac553fa8ec6 --- /dev/null +++ b/needlepoint/__init__.py @@ -0,0 +1,2 @@ +"""NEEDLEPOINT: proof-carrying instrument-reading task factory.""" +__version__ = "0.1.0" diff --git a/needlepoint/ablation.py b/needlepoint/ablation.py new file mode 100644 index 0000000000000000000000000000000000000000..4221b7ebc255b7c52749f40a9d57feaf386d4d57 --- /dev/null +++ b/needlepoint/ablation.py @@ -0,0 +1,115 @@ +"""Surface-vs-structure ablation (the organizer's "marquee" example, measured). + +For each base READ task (single dial) we create two variants with the *same reading and answer*: + surface : only colours change (face, ink, needle, bezel, background) + structure : only geometry changes (sweep angle, minor-tick density, label spacing) +If variation that the factory counts as "meaningful" really is meaningful, structural edits +should change model correctness far more often than surface edits. +""" +from __future__ import annotations + +import json +from pathlib import Path + +import numpy as np + +from . import catalog, gates, ops +from . import panel as P +from .factory import _task_id, write_task + + +def _restyle(panel, rng): + p = panel.model_copy(deep=True) + x = p.instruments[0] + old = dict(x.style) + for key, pal in (("face", catalog.FACES), ("ink", catalog.INKS), ("needle", catalog.NEEDLES), ("bezel", catalog.BEZELS)): + choices = [c for c in pal if tuple(c) != tuple(old[key])] + x.style[key] = tuple(choices[rng.integers(len(choices))]) + bgs = [c for c in catalog.PANEL_BG if tuple(c) != tuple(p.background)] + p.background = tuple(bgs[rng.integers(len(bgs))]) + return p + + +def _regeom(panel, rng, entry_minors): + p = panel.model_copy(deep=True) + x = p.instruments[0] + g = dict(x.geom) + sweeps = [s for s in (180, 240, 270, 300) if s != g["sweep"]] + g["sweep"] = float(sweeps[rng.integers(len(sweeps))]) + g["start"] = 90 + g["sweep"] / 2 + if x.scale.n_major >= 6: + g["label_every"] = 2 if g["label_every"] == 1 else 1 + x.geom = g + minors = [m for m in entry_minors if m != x.scale.minor_per] + if minors: + new_minor = int(minors[rng.integers(len(minors))]) + step = x.scale.major_step / new_minor / 2 + if abs(round(x.value / step) * step - x.value) < 1e-9: # reading must stay on the new readable grid + x.scale = x.scale.model_copy(update={"minor_per": new_minor}) + return p + + +def build_ablation(out: Path, n: int = 30, seed: int = 404) -> dict: + out = Path(out) + rng = np.random.default_rng(seed) + triples = [] + k = 0 + while len(triples) < n and k < n * 40: + k += 1 + s = seed * 1_000_000 + k + base = P.sample_panel(s, "industrial", 1, kinds=["dial"], difficulty=3) + x = base.instruments[0] + if x.scale.factor != 1: + continue + entry = next((e for e in catalog.INDUSTRIAL if e[1] == x.scale.unit and e[2] == x.scale.vmin + and e[3] == x.scale.vmax), None) + if entry is None: + continue + arms = {"base": base, "surface": _restyle(base, rng), "structure": _regeom(base, rng, entry[5])} + built = {} + for arm, p in arms.items(): + q = ops.read(p, 0) + img = P.render(p) + rep = gates.run_all(p, img, q) + if not rep["passed"]: + break + built[arm] = (p, q, img, rep) + if len(built) < 3: + continue + ids = {} + for arm, (p, q, img, rep) in built.items(): + tid = _task_id(s, "READ", arm) + write_task(out, tid, p, img, q, rep, 3) + ids[arm] = tid + triples.append(ids) + man = {"seed": seed, "triples": triples, "n": len(triples), "candidates": k} + (out / "ablation_manifest.json").write_text(json.dumps(man, indent=2)) + return man + + +def ablation_report(run_dir: Path) -> dict: + from .analysis import load_results, wilson + from .evaluate import score + run_dir = Path(run_dir) + man = json.loads((run_dir / "ablation_manifest.json").read_text()) + res = load_results(run_dir, "image") + models = sorted({m for m, _ in res}) + out = {} + for m in models: + acc = {"base": [], "surface": [], "structure": []} + flips = {"surface": 0, "structure": 0} + n = 0 + for t in man["triples"]: + if not all((m, t[a]) in res for a in acc): + continue + n += 1 + c = {a: score(json.loads((run_dir / "tasks" / t[a] / "answer.json").read_text()), res[(m, t[a])]["answer"]) for a in acc} + for a in acc: + acc[a].append(c[a]) + for a in flips: + flips[a] += c[a] != c["base"] + out[m] = {"n_triples": n, **{f"acc_{a}": wilson(int(sum(v)), len(v)) for a, v in acc.items()}, + "correctness_flip_rate_surface": wilson(flips["surface"], n), + "correctness_flip_rate_structure": wilson(flips["structure"], n)} + (run_dir / "ablation_report.json").write_text(json.dumps(out, indent=2)) + return out diff --git a/needlepoint/analysis.py b/needlepoint/analysis.py new file mode 100644 index 0000000000000000000000000000000000000000..991a46c1ab35d7b00959a6904fa330eff0036702 --- /dev/null +++ b/needlepoint/analysis.py @@ -0,0 +1,134 @@ +"""Metrics, twin consistency, reading/decision disagreement and automatic error attribution.""" +from __future__ import annotations + +import json +import math +from collections import Counter, defaultdict +from pathlib import Path + +from .evaluate import _num, is_abstention + + +def wilson(k: int, n: int, z: float = 1.96): + if n == 0: + return (0.0, 0.0, 0.0) + p = k / n + d = 1 + z * z / n + c = (p + z * z / (2 * n)) / d + h = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / d + return (round(p, 4), round(max(0, c - h), 4), round(min(1, c + h), 4)) + + +def load_results(run_dir: Path, mode: str = "image") -> dict: + """Latest record per (model, task) from cache (authoritative).""" + out = {} + for f in (Path(run_dir) / "eval" / "cache").glob(f"*/*__{mode}.json"): + r = json.loads(f.read_text()) + out[(r["model"], r["task_id"])] = r + return out + + +def attribute(cert: dict, expected: dict, got) -> str: + """Classify a wrong answer using the full (known) panel state.""" + t = expected["answer_type"] + spec = cert["spec"] + insts = spec["instruments"] + tags = cert["targets"] + if got is None or (isinstance(got, str) and not got.strip()): + return "no_answer" + if t == "abstain": + return "hallucinated_reading" if _num(got) is not None else "other" + if t in ("yesno", "tag", "int"): + if t == "tag": + return "picked_other_instrument" if any(str(got).upper() == i["tag"].upper() for i in insts) else "invalid_tag" + if t == "int": + g = _num(got) + return "count_off_by_one" if g is not None and abs(g - expected["answer"]) == 1 else "count_off_by_more" + return "wrong_decision" + g = _num(got) + if g is None: + return "unparseable" + if is_abstention(got): + return "false_abstention" + tgt = next(i for i in insts if i["tag"] == tags[0]) + sc = tgt["scale"] + minor = sc["major_step"] / sc["minor_per"] if tgt["kind"] != "digital" else 10 ** (-sc["decimals"]) + true = expected["answer"] + if cert["op"] == "SCALE": + if abs(g - tgt["value"]) <= expected["tolerance"] / sc["factor"] + 1e-9: + return "multiplier_ignored" + return "other_large" + for o in insts: + if o["tag"] != tgt["tag"] and abs(g - o["value"]) <= 0.5 * minor + 1e-9 and abs(g - true) > 1.5 * minor: + return "binding_error_read_other_instrument" + if cert["op"] == "DIFF": + return "arithmetic_or_read_error" + if tgt["kind"] != "digital": + majors = [sc["vmin"] + k * sc["major_step"] for k in range(int(round((sc["vmax"] - sc["vmin"]) / sc["major_step"])) + 1)] + nm = min(majors, key=lambda m: abs(m - g)) + if abs(g - nm) < 1e-9 and abs(true - nm) > expected["tolerance"]: + return "snapped_to_major_tick" + err = abs(g - true) + if err <= 1.5 * minor: + return "off_by_one_minor_tick" + if err <= 3.5 * minor: + return "interpolation_error_2_3_ticks" + for f in (10, 0.1, 2, 0.5): + if abs(g - true * f) <= expected["tolerance"] * max(1, f): + return "scale_slip" + if g < sc["vmin"] - 1e-9 or g > sc["vmax"] + 1e-9: + return "outside_scale_range" + return "other_large" + + +def pilot_report(run_dir: Path) -> dict: + run_dir = Path(run_dir) + man = json.loads((run_dir / "pilot_manifest.json").read_text()) + res = load_results(run_dir, "image") + blind = load_results(run_dir, "blind") + models = sorted({m for m, _ in res}) + group_of = {t: g for g, ids in man["groups"].items() for t in ids} + report = {"models": {}, "n_tasks": man["n_tasks"]} + for m in models: + rows = {t: r for (mm, t), r in res.items() if mm == m} + by = defaultdict(list) + attrib = Counter() + for t, r in rows.items(): + d = run_dir / "tasks" / t + exp = json.loads((d / "answer.json").read_text()) + cert = json.loads((d / "certificate.json").read_text()) + from .evaluate import score + c = score(exp, r["answer"]) + r["correct"] = c + by[group_of.get(t, cert["op"])].append(c) + by["ALL"].append(c) + if c < 1: + attrib[f"{cert['op']}:{attribute(cert, exp, r['answer'])}"] += 1 + pairs = both = 0 + decision_disagree = [] + for L in man["thresh_links"]: + a, b, rd = rows.get(L["thresh"]), rows.get(L["twin"]), rows.get(L["read_same_gauge"]) + if a and b: + pairs += 1 + both += int(a["correct"] == 1 and b["correct"] == 1) + if a and rd: + decision_disagree.append(int(a["correct"] != rd["correct"])) + mrep = {g: {"n": len(v), "acc_ci95": wilson(int(sum(v)), len(v))} for g, v in by.items()} + mrep["THRESH_twin_pair_both_correct"] = wilson(both, pairs) + mrep["THRESH_single_item_acc"] = mrep.get("THRESH_PAIR", {}).get("acc_ci95") + mrep["reading_vs_decision_disagreement"] = wilson(sum(decision_disagree), len(decision_disagree)) + mrep["error_attribution"] = dict(attrib.most_common()) + mrep["cost_usd"] = round(sum(r.get("cost_usd", 0) for r in rows.values()), 4) + mrep["mean_output_tokens"] = round(sum(r.get("output_tokens", 0) for r in rows.values()) / max(1, len(rows)), 1) + mrep["parse_failures"] = sum(1 for r in rows.values() if not r.get("parsed")) + brow = {t: r for (mm, t), r in blind.items() if mm == m} + if brow: + bc = [] + for t, r in brow.items(): + exp = json.loads((run_dir / "tasks" / t / "answer.json").read_text()) + from .evaluate import score + bc.append(score(exp, r["answer"])) + mrep["blind_text_only_acc"] = wilson(int(sum(bc)), len(bc)) + report["models"][m] = mrep + (run_dir / "pilot_report.json").write_text(json.dumps(report, indent=2)) + return report diff --git a/needlepoint/atlas_probe.py b/needlepoint/atlas_probe.py new file mode 100644 index 0000000000000000000000000000000000000000..fbccce67d61de22cae055f200951ac404b7c3015 --- /dev/null +++ b/needlepoint/atlas_probe.py @@ -0,0 +1,215 @@ +"""ATLAS probe: procedural floor plans with doors, blocked doors and exits. + +Minimal falsification probe (EXP-04): do frontier VLMs fail route/egress questions whose +answers are computed exactly by graph search? Ground truth = room-adjacency graph with door +edges (blocked doors removed). Not yet gated by an image-only decoder (probe only). +""" +from __future__ import annotations + +import hashlib +import json +from collections import deque +from pathlib import Path + +import numpy as np +from PIL import Image, ImageDraw + +from .fonts import font + +W, H = 1024, 768 +WALL = (30, 30, 34) +FLOOR = (246, 244, 238) +BLOCK = (210, 30, 30) +EXITC = (20, 140, 60) + + +def _split(rng, rect, min_w, min_h, depth=0): + x0, y0, x1, y1 = rect + w, h = x1 - x0, y1 - y0 + can_v, can_h = w >= 2 * min_w, h >= 2 * min_h + if depth > 6 or not (can_v or can_h) or (depth >= 2 and rng.random() < 0.25): + return [rect] + if can_v and (not can_h or w >= h): + c = int(rng.integers(x0 + min_w, x1 - min_w + 1)) + return _split(rng, (x0, y0, c, y1), min_w, min_h, depth + 1) + _split(rng, (c, y0, x1, y1), min_w, min_h, depth + 1) + c = int(rng.integers(y0 + min_h, y1 - min_h + 1)) + return _split(rng, (x0, y0, x1, c), min_w, min_h, depth + 1) + _split(rng, (x0, c, x1, y1), min_w, min_h, depth + 1) + + +def _shared(a, b): + """Shared wall segment between rectangles a and b (or None).""" + if a[2] == b[0] or b[2] == a[0]: + x = a[2] if a[2] == b[0] else a[0] + lo, hi = max(a[1], b[1]), min(a[3], b[3]) + if hi - lo >= 60: + return ("v", x, lo, hi) + if a[3] == b[1] or b[3] == a[1]: + y = a[3] if a[3] == b[1] else a[1] + lo, hi = max(a[0], b[0]), min(a[2], b[2]) + if hi - lo >= 60: + return ("h", y, lo, hi) + return None + + +def sample(seed: int, n_target: int = 10, min_w: int = 150, min_h: int = 120, max_depth: int = 6): + rng = np.random.default_rng(seed) + foot = (40, 40, W - 40, H - 40) + rooms = _split(rng, foot, min_w, min_h, -(max_depth - 6)) + rng.shuffle(rooms) + edges = [] + for i in range(len(rooms)): + for j in range(i + 1, len(rooms)): + s = _shared(rooms[i], rooms[j]) + if s: + edges.append((i, j, s)) + # spanning tree + some loops + parent = list(range(len(rooms))) + + def f(x): + while parent[x] != x: + parent[x] = parent[parent[x]] + x = parent[x] + return x + order = rng.permutation(len(edges)) + doors = [] + for k in order: + i, j, s = edges[k] + if f(i) != f(j) or rng.random() < 0.3: + parent[f(i)] = f(j) + kind, c, lo, hi = s + pos = int(rng.integers(lo + 25, hi - 25)) + doors.append({"a": i, "b": j, "orient": kind, "c": c, "pos": pos, "blocked": bool(rng.random() < 0.22)}) + # exits on outer walls + exits = [] + cand = [i for i, r in enumerate(rooms) if r[0] == foot[0] or r[2] == foot[2] or r[1] == foot[1] or r[3] == foot[3]] + rng.shuffle(cand) + for k, i in enumerate(cand[: int(rng.integers(2, 4))]): + r = rooms[i] + if r[0] == foot[0]: + e = ("v", r[0], int(rng.integers(r[1] + 30, r[3] - 30))) + elif r[2] == foot[2]: + e = ("v", r[2], int(rng.integers(r[1] + 30, r[3] - 30))) + elif r[1] == foot[1]: + e = ("h", r[1], int(rng.integers(r[0] + 30, r[2] - 30))) + else: + e = ("h", r[3], int(rng.integers(r[0] + 30, r[2] - 30))) + exits.append({"room": i, "orient": e[0], "c": e[1], "pos": e[2], "name": f"E{k + 1}"}) + names = rng.permutation(np.arange(101, 101 + 3 * len(rooms)))[: len(rooms)] + return {"seed": seed, "rooms": rooms, "doors": doors, "exits": exits, "names": [f"Room {n}" for n in names]} + + +def graph(plan): + adj = {i: [] for i in range(len(plan["rooms"]))} + for d in plan["doors"]: + if not d["blocked"]: + adj[d["a"]].append(d["b"]) + adj[d["b"]].append(d["a"]) + return adj + + +def doors_to_exits(plan, start): + """BFS: number of doorways crossed (incl. the exit doorway) to reach each exit.""" + adj = graph(plan) + dist = {start: 0} + q = deque([start]) + while q: + u = q.popleft() + for v in adj[u]: + if v not in dist: + dist[v] = dist[u] + 1 + q.append(v) + return {e["name"]: dist[e["room"]] + 1 for e in plan["exits"] if e["room"] in dist} + + +def render(plan) -> Image.Image: + img = Image.new("RGB", (W, H), (210, 212, 216)) + d = ImageDraw.Draw(img) + for r in plan["rooms"]: + d.rectangle(r, fill=FLOOR) + for r in plan["rooms"]: + d.rectangle(r, outline=WALL, width=6) + gap = 30 + for door in plan["doors"]: + if door["orient"] == "v": + x, y = door["c"], door["pos"] + d.rectangle([x - 4, y - gap / 2, x + 4, y + gap / 2], fill=FLOOR) + if door["blocked"]: + d.rectangle([x - 3, y - gap / 2, x + 3, y + gap / 2], fill=BLOCK) + d.line([x - 9, y - 9, x + 9, y + 9], fill=BLOCK, width=3); d.line([x - 9, y + 9, x + 9, y - 9], fill=BLOCK, width=3) + else: + x, y = door["pos"], door["c"] + d.rectangle([x - gap / 2, y - 4, x + gap / 2, y + 4], fill=FLOOR) + if door["blocked"]: + d.rectangle([x - gap / 2, y - 3, x + gap / 2, y + 3], fill=BLOCK) + d.line([x - 9, y - 9, x + 9, y + 9], fill=BLOCK, width=3); d.line([x - 9, y + 9, x + 9, y - 9], fill=BLOCK, width=3) + for e in plan["exits"]: + if e["orient"] == "v": + x, y = e["c"], e["pos"] + d.rectangle([x - 5, y - gap / 2, x + 5, y + gap / 2], fill=EXITC) + lx = x - 26 if x > W / 2 else x + 26 + d.text((lx, y), e["name"], fill=EXITC, font=font(16, "bold"), anchor="mm") + else: + x, y = e["pos"], e["c"] + d.rectangle([x - gap / 2, y - 5, x + gap / 2, y + 5], fill=EXITC) + ly = y - 18 if y > H / 2 else y + 18 + d.text((x, ly), e["name"], fill=EXITC, font=font(16, "bold"), anchor="mm") + for r, nm in zip(plan["rooms"], plan["names"]): + d.text(((r[0] + r[2]) / 2, (r[1] + r[3]) / 2), nm, fill=(20, 20, 20), font=font(15), anchor="mm") + lx, ly = 50, H - 30 + d.rectangle([lx, ly - 6, lx + 24, ly + 6], fill=BLOCK); d.text((lx + 32, ly), "blocked door", fill=(20, 20, 20), font=font(13), anchor="lm") + d.rectangle([lx + 160, ly - 6, lx + 184, ly + 6], fill=EXITC); d.text((lx + 192, ly), "exit", fill=(20, 20, 20), font=font(13), anchor="lm") + return img + + +def questions(plan, rng): + out = [] + n = len(plan["rooms"]) + starts = rng.permutation(n) + for s in starts: + res = doors_to_exits(plan, int(s)) + name = plan["names"][s] + if not res: + out.append(("REACH", f"Starting in {name}, can you reach any exit without passing through a blocked door? Answer yes or no.", "no", "yesno")) + continue + out.append(("REACH", f"Starting in {name}, can you reach any exit without passing through a blocked door? Answer yes or no.", "yes", "yesno")) + best = min(res.values()) + winners = [k for k, v in res.items() if v == best] + out.append(("DOORS", f"Starting in {name} and never passing through a blocked door, what is the minimum number of doorways you must pass through to get outside (count the exit doorway too)?", best, "int")) + if len(winners) == 1 and len(res) >= 2: + out.append(("WHICH_EXIT", f"Starting in {name} and never passing through a blocked door, which exit can you reach by passing through the fewest doorways? Answer with the exit label.", winners[0], "tag")) + return out + + +def build_probe(out: Path, n: int = 30, seed: int = 777, min_w: int = 150, min_h: int = 120, + min_rooms: int = 6, min_doors: int = 1, max_depth: int = 6) -> dict: + out = Path(out) + rng = np.random.default_rng(seed) + want = {"REACH": n // 3, "DOORS": n // 3, "WHICH_EXIT": n - 2 * (n // 3)} + got = {k: 0 for k in want} + yes_no = {"yes": 0, "no": 0} + k = 0 + while any(got[o] < want[o] for o in want): + k += 1 + plan = sample(seed * 1000 + k, min_w=min_w, min_h=min_h, max_depth=max_depth) + if len(plan["rooms"]) < min_rooms or not plan["exits"]: + continue + img = render(plan) + for op, q, a, t in questions(plan, rng): + if got[op] >= want[op]: + continue + if op in ("DOORS",) and a < min_doors: + continue + if op == "REACH" and yes_no[a] >= want["REACH"] / 2 + 1: + continue + tid = "at-" + hashlib.sha256(f"{seed}:{k}:{q}".encode()).hexdigest()[:12] + d = out / "tasks" / tid + d.mkdir(parents=True, exist_ok=True) + img.save(d / "image.png") + (d / "task.json").write_text(json.dumps({"task_id": tid, "image": "image.png", "question": q, "answer_type": t, "unit": ""})) + (d / "answer.json").write_text(json.dumps({"answer": a, "answer_type": t, "tolerance": 0.0, "unit": ""})) + (d / "certificate.json").write_text(json.dumps({"task_id": tid, "op": op, "plan": plan, "targets": []}, default=int)) + got[op] += 1 + if op == "REACH": + yes_no[a] += 1 + break + return {"tasks": got, "reach_balance": yes_no, "plans_used": k} diff --git a/needlepoint/catalog.py b/needlepoint/catalog.py new file mode 100644 index 0000000000000000000000000000000000000000..68fda6fda4ca0acc3f918a854f7ca7bc1a0baab8 --- /dev/null +++ b/needlepoint/catalog.py @@ -0,0 +1,51 @@ +"""Instrument catalogue: physical quantities, units, realistic ranges, tag prefixes. + +All names, tags and devices are fictional and generic (no PII, no real products). +Each entry: (quantity, unit, vmin, vmax, major_step, minor_per options, decimals, tag prefix, factor) +""" +from __future__ import annotations + +INDUSTRIAL = [ + ("pressure", "bar", 0, 10, 1, (2, 5, 10), 0, "PT", 1), + ("pressure", "bar", 0, 16, 2, (2, 4), 0, "PT", 1), + ("pressure", "bar", -1, 3, 0.5, (5,), 1, "PT", 1), + ("pressure", "psi", 0, 160, 20, (2, 4), 0, "PT", 1), + ("pressure", "kPa", 0, 600, 100, (2, 5), 0, "PT", 1), + ("pressure", "MPa", 0, 1.6, 0.2, (2, 4), 1, "PT", 1), + ("temperature", "°C", 0, 120, 20, (2, 4), 0, "TT", 1), + ("temperature", "°C", -20, 60, 10, (2, 5), 0, "TT", 1), + ("temperature", "°C", 0, 400, 50, (5,), 0, "TT", 1), + ("temperature", "°F", 30, 230, 20, (2, 4), 0, "TT", 1), + ("flow", "L/min", 0, 50, 5, (5,), 0, "FT", 1), + ("flow", "m³/h", 0, 100, 10, (2, 5), 0, "FT", 1), + ("level", "%", 0, 100, 10, (2, 5), 0, "LT", 1), + ("level", "m", 0, 5, 0.5, (5,), 1, "LT", 1), + ("speed", "rpm ×100", 0, 40, 5, (5,), 0, "ST", 100), + ("speed", "rpm ×1000", 0, 8, 1, (2, 5), 0, "ST", 1000), + ("current", "A", 0, 50, 10, (2, 5), 0, "IT", 1), + ("voltage", "V", 0, 300, 50, (5,), 0, "ET", 1), + ("power", "kW", 0, 30, 5, (5,), 0, "JT", 1), +] + +HEALTHCARE = [ + # Perceptual reading only. Generic, fictional equipment; no clinical questions are generated. + ("gas-cylinder", "bar", 0, 250, 50, (5,), 0, "O2 CYL", 1), + ("gas-cylinder", "kgf/cm²", 0, 200, 25, (5,), 0, "O2 CYL", 1), + ("bp-dial", "mmHg", 0, 300, 20, (2, 10), 0, "BP", 1), + ("flowmeter", "L/min", 0, 15, 1, (2, 4), 0, "O2 FLOW", 1), + ("vacuum", "kPa", -100, 0, 20, (2, 4), 0, "SUCTION", 1), + ("infusion", "mL/h", 0, 999.9, 100, (1,), 1, "PUMP", 1), # digital only + ("temperature", "°C", 30, 45, 1, (5,), 0, "TEMP", 1), +] + +PROFILES = {"industrial": INDUSTRIAL, "healthcare": HEALTHCARE} + +# Surface palettes (surface variation: tracked, never counted as "meaningful" variation) +PANEL_BG = [(62, 66, 72), (88, 96, 104), (110, 118, 112), (74, 84, 98), (96, 90, 82)] +FACES = [(238, 238, 230), (246, 246, 246), (236, 232, 214), (226, 232, 236)] +INKS = [(22, 22, 22), (18, 30, 72), (40, 40, 44)] +NEEDLES = [(22, 22, 22), (20, 40, 110), (30, 80, 40)] # red is reserved for alarm meaning +BEZELS = [(40, 40, 42), (150, 150, 155), (90, 70, 40), (30, 50, 80)] +SEGMENTS = [(60, 255, 120), (255, 180, 40), (90, 220, 255), (240, 240, 240)] # no red digits +FILLS = [(40, 110, 210), (60, 160, 80), (30, 150, 160), (120, 90, 180)] # no red/orange fills (human check found a red fill read as an alarm zone) +BAND = (205, 35, 35) diff --git a/needlepoint/cli.py b/needlepoint/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..5145af8ab4e85780c3024ba7a694b06aaa8724cd --- /dev/null +++ b/needlepoint/cli.py @@ -0,0 +1,156 @@ +"""NEEDLEPOINT command-line interface. + + needlepoint generate --out runs/demo --n 200 --seed 42 + needlepoint faults --out runs/demo # gate fault injection + checker mutation tests + needlepoint harbor --out runs/demo [--limit 20] # export Harbor 0.25 task packages + needlepoint eval --out runs/demo --model claude-haiku-5-5 [--blind] + needlepoint pilot --out runs/exp02_pilot # build the EXP-02 pilot set + needlepoint report --out runs/exp02_pilot # pilot metrics + error attribution + needlepoint humancheck --out runs/exp02_pilot # build / score the blind human hand-check + needlepoint budget # show API spend vs caps +""" +from __future__ import annotations + +import json +from pathlib import Path +from typing import List, Optional + +import typer + +app = typer.Typer(add_completion=False, help="Proof-carrying instrument-reading task factory.") + + +@app.command() +def generate(out: Path = typer.Option(..., help="Run directory"), n: int = 100, seed: int = 0, + family: str = typer.Option("instruments", help="instruments | wiring"), + profile: str = "industrial", no_twins: bool = False, + levels: str = typer.Option("1,2,3,4,5,6", help="wiring difficulty levels"), + difficulties: str = typer.Option("1,2,3,4", help="instrument difficulty levels to sample (1-5)")): + """Generate certified tasks (all gates must pass). For wiring, N is tasks per level.""" + if family == "wiring": + from .wiring import generate as wgen + wgen(out, per_level=n, levels=tuple(int(x) for x in levels.split(",")), seed=seed) + else: + from .factory import generate as gen + gen(out, n, seed=seed, profile=profile, twins=not no_twins, + difficulties=tuple(int(x) for x in difficulties.split(","))) + + +@app.command() +def faults(out: Path = typer.Option(...), per_class: int = 60, clean: int = 200, seed: int = 7): + """Measure gate recall on planted defects and run checker mutation tests.""" + from .faults import checker_mutation_suite, gate_fault_suite + out.mkdir(parents=True, exist_ok=True) + g = gate_fault_suite(per_class, clean, seed) + c = checker_mutation_suite(out) if (out / "tasks").exists() else {"skipped": "no tasks in run dir"} + (out / "faults_report.json").write_text(json.dumps({"gate_fault_injection": g, "checker_mutation": c}, indent=2)) + typer.echo(json.dumps({k: (v["recall_any_gate"], v["recall_intended_gate"]) for k, v in g["classes"].items()}, indent=1)) + typer.echo(f"clean false-rejection: {g['clean']['false_rejection_rate']}; checker all_ok: {c.get('all_ok')}") + + +@app.command() +def harbor(out: Path = typer.Option(...), limit: Optional[int] = None, dest: Optional[Path] = None): + """Export tasks as Harbor 0.25 packages (validate with: harbor run -p -a nop|oracle).""" + from .harbor_export import export_all + ps = export_all(out, dest, limit) + typer.echo(f"exported {len(ps)} Harbor tasks to {(dest or out / 'harbor')}") + + +@app.command("eval") +def eval_(out: Path = typer.Option(...), model: List[str] = typer.Option(...), blind: bool = False, + task: Optional[List[str]] = None, workers: int = 4): + """Evaluate models (budget-capped, cached). Requires API keys in .env.""" + from .evaluate import run + run(out, list(model), task_ids=task, blind=blind, workers=workers) + + +@app.command() +def pilot(out: Path = typer.Option(...), seed: int = 2026): + from .pilot import build_pilot + m = build_pilot(out, seed) + typer.echo(json.dumps({k: len(v) for k, v in m["groups"].items()})) + + +@app.command() +def report(run: List[Path] = typer.Option(..., help="run directory (repeatable)"), + dest: Path = typer.Option(Path("runs/report"), help="where report.md/.html are written"), + title: str = "NEEDLEPOINT evidence report"): + """Build the evidence report (Markdown + self-contained HTML) from one or more runs.""" + from .report import build_report + typer.echo(str(build_report(list(run), dest, title))) + + +@app.command("pilot-report") +def pilot_report_cmd(out: Path = typer.Option(...)): + from .analysis import pilot_report + typer.echo(json.dumps(pilot_report(out), indent=1)) + + +@app.command() +def ledger(out: Path = typer.Option(...)): + """Variation ledger: coverage, structural entropy, duplicates, answer balance.""" + from .ledger import build_ledger + typer.echo(json.dumps(build_ledger(out), indent=1, default=str)) + + +@app.command() +def ablation(out: Path = typer.Option(...), n: int = 40, seed: int = 404, report_only: bool = False): + """Surface-vs-structure ablation set (evaluate it with `eval`, then re-run with --report-only).""" + from .ablation import ablation_report, build_ablation + typer.echo(json.dumps(ablation_report(out) if report_only else build_ablation(out, n, seed), indent=1)) + + +@app.command() +def humancheck(out: Path = typer.Option(...), n: int = 30, score: bool = False): + from .humancheck import build_page, score_human + typer.echo(json.dumps(score_human(out), indent=1) if score else str(build_page(out, n))) + + +@app.command() +def budget(): + from .evaluate import CAPS, Ledger + led = Ledger() + for p, cap in CAPS.items(): + typer.echo(f"{p:10s} spent ${led.spent(p):8.4f} / cap ${cap:.2f}") + + +@app.command() +def recipe(path: Path = typer.Argument(..., help="recipe JSON (see recipes/)"), + out: Path = typer.Option(Path("runs/recipes"), help="parent directory for the dataset")): + """Build a whole dataset from a versioned recipe (same recipe + version = byte-identical tasks).""" + from .factory import generate as gen + from .ledger import build_ledger + from .wiring import generate as wgen + r = json.loads(path.read_text()) + root = out / r["name"] + for s in r["sets"]: + d = root / s["name"] + if s["family"] == "wiring": + wgen(d, per_level=s["per_level"], levels=tuple(s["levels"]), seed=s["seed"], log=lambda *_: None) + else: + gen(d, s["n"], seed=s["seed"], profile=s.get("profile", "industrial"), + difficulties=tuple(s.get("difficulties", [1, 2, 3, 4])), log=lambda *_: None) + L = build_ledger(d) + typer.echo(f"{s['name']:12s} {L['n_tasks']:4d} tasks {L['structural']['unique_signatures']} structural signatures " + f"true duplicates {L['duplicates']['true_duplicates']} -> {d}") + (root / "recipe.json").write_text(json.dumps(r, indent=2)) + + +@app.command() +def clean(keep: int = typer.Option(0, help="Studio runs to keep (newest first)")): + """Remove generated Studio runs (runs/studio). Evidence and your own run folders are never touched.""" + from .server import RUNS, prune_runs + n = prune_runs(keep) + typer.echo(f"removed {n} Studio run(s) from {RUNS}; kept {keep}") + + +@app.command() +def serve(host: str = "127.0.0.1", port: int = 8000): + """Start NEEDLEPOINT Studio (web app + REST API; API docs at /docs).""" + import uvicorn + typer.echo(f"NEEDLEPOINT Studio -> http://{host}:{port} (API docs: http://{host}:{port}/docs)") + uvicorn.run("needlepoint.server:app", host=host, port=port, log_level="warning") + + +if __name__ == "__main__": + app() diff --git a/needlepoint/evaluate.py b/needlepoint/evaluate.py new file mode 100644 index 0000000000000000000000000000000000000000..19cfb1fb3ad5b15fe063552826dd21db8b1a524b --- /dev/null +++ b/needlepoint/evaluate.py @@ -0,0 +1,254 @@ +"""Budget-capped, cached model evaluation on NEEDLEPOINT tasks. + +Models under test receive ONLY the PNG and the question text (plus a fixed answer-format +instruction). Nothing from the spec, answer or certificate is ever sent. +""" +from __future__ import annotations + +import base64 +import json +import os +import re +import threading +import time +from concurrent.futures import ThreadPoolExecutor, as_completed +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +LEDGER = ROOT / ".cache" / "budget_ledger.json" + +# USD per 1M tokens (input, output). Sources: provider pricing pages accessed 2026-11-26 +# (see research/11_cost_and_feasibility.md). Reasoning tokens are billed as output. +PRICES = { + "claude-opus-5-5": (4.00, 20.00), "claude-sonnet-5-5": (2.00, 10.00), "claude-haiku-5-5": (0.10, 0.50), + "gpt-6.2-astra": (8.00, 40.00), "gpt-6-luna": (0.10, 0.50), + "gemini-3.1-pro-preview": (2.00, 12.00), "gemini-3.8-flash": (0.75, 3.75), + "gemini-3.1-flash-lite": (0.10, 0.40), # not on the fetched price page; small, treated as an estimate +} +PROVIDER = {m: ("anthropic" if m.startswith("claude") else "openai" if m.startswith("gpt") else "gemini") for m in PRICES} +CAPS = {"anthropic": 17.00, "openai": 17.00, "gemini": 3.40} # user budget $20/$20/$4 minus ~15% reserve +MAX_OUT = {"default": 3000} + +SCENE = {"instruments": "an image of an instrument panel", "wiring": "an image of a wiring diagram between two terminal blocks"} +PROMPT = """You are shown {scene}. Answer the question using only what is visible in the image. +If the value cannot be determined from the image, answer "cannot determine". +Respond with ONLY a JSON object of the form {{"answer": , "confidence": }}. +{fmt} + +Question: {question}""" +BLIND_NOTE = "\nNote: the image is NOT available to you. Give your best guess anyway." +FMT = { + "number": "The answer must be a plain number (no units).", + "int": "The answer must be an integer.", + "yesno": 'The answer must be "yes" or "no".', + "tag": "The answer must be the instrument tag exactly as printed.", + "abstain": "The answer must be a plain number (no units).", +} + +_lock = threading.Lock() + + +def _env(): + for p in (ROOT / ".env", ROOT.parent / ".env"): + if p.exists(): + for line in p.read_text().splitlines(): + line = line.strip() + if line and not line.startswith("#") and "=" in line: + k, v = line.split("=", 1) + os.environ.setdefault(k.strip(), v.strip().strip('"').strip("'")) + + +class BudgetExceeded(RuntimeError): + pass + + +class Ledger: + def __init__(self, path: Path = LEDGER): + self.path = path + path.parent.mkdir(parents=True, exist_ok=True) + self.data = json.loads(path.read_text()) if path.exists() else {"spent": {}, "calls": {}} + + def spent(self, provider: str) -> float: + return self.data["spent"].get(provider, 0.0) + + def reserve_check(self, model: str, est_in: int, max_out: int): + prov = PROVIDER[model] + pi, po = PRICES[model] + worst = (est_in * pi + max_out * po) / 1e6 + if self.spent(prov) + worst > CAPS[prov]: + raise BudgetExceeded(f"{prov}: spent ${self.spent(prov):.4f} + worst-case ${worst:.4f} > cap ${CAPS[prov]:.2f}") + + def add(self, model: str, tin: int, tout: int) -> float: + pi, po = PRICES[model] + cost = (tin * pi + tout * po) / 1e6 + prov = PROVIDER[model] + with _lock: + self.data["spent"][prov] = round(self.spent(prov) + cost, 6) + self.data["calls"][model] = self.data["calls"].get(model, 0) + 1 + self.path.write_text(json.dumps(self.data, indent=2)) + return cost + + +# ----------------------------------------------------------------------------- adapters +def _anthropic(model, png, prompt, max_out): + import anthropic + client = anthropic.Anthropic(timeout=120.0, max_retries=2) + content = ([{"type": "image", "source": {"type": "base64", "media_type": "image/png", + "data": base64.standard_b64encode(png).decode()}}] if png else []) + content.append({"type": "text", "text": prompt}) + kw = dict(model=model, max_tokens=max_out, messages=[{"role": "user", "content": content}], + output_config={"effort": "low"}) + if "haiku" in model: + kw["thinking"] = {"type": "disabled"} # allowed on Haiku 5.5 at effort <= high; Opus 5.5 cannot disable + r = client.messages.create(**kw) + text = "".join(b.text for b in r.content if b.type == "text") + return text, r.usage.input_tokens, r.usage.output_tokens, r.stop_reason + + +def _openai(model, png, prompt, max_out): + from openai import OpenAI + client = OpenAI(timeout=120.0, max_retries=2) + content = [{"type": "input_text", "text": prompt}] + if png: + content.append({"type": "input_image", "image_url": "data:image/png;base64," + base64.b64encode(png).decode(), + "detail": "high"}) + r = client.responses.create(model=model, input=[{"role": "user", "content": content}], + reasoning={"effort": "low"}, max_output_tokens=max_out) + return r.output_text, r.usage.input_tokens, r.usage.output_tokens, getattr(r, "status", "") + + +def _gemini(model, png, prompt, max_out): + from google import genai + from google.genai import types + client = genai.Client(api_key=os.environ["GEMINI_API_KEY"], + http_options=types.HttpOptions(timeout=90_000, api_version="v1beta")) + parts = ([types.Part.from_bytes(data=png, mime_type="image/png")] if png else []) + [prompt] + cfg = types.GenerateContentConfig(max_output_tokens=max_out, + thinking_config=types.ThinkingConfig(thinking_level="low")) + r = client.models.generate_content(model=model, contents=parts, config=cfg) + um = r.usage_metadata + tout = (um.candidates_token_count or 0) + (getattr(um, "thoughts_token_count", 0) or 0) + return (r.text or ""), um.prompt_token_count or 0, tout, str(r.candidates[0].finish_reason if r.candidates else "") + + +ADAPTERS = {"anthropic": _anthropic, "openai": _openai, "gemini": _gemini} + + +# ----------------------------------------------------------------------------- parsing / scoring +def parse(text: str): + m = re.findall(r"\{[^{}]*\}", text or "", flags=re.S) + for blob in reversed(m): + try: + d = json.loads(blob) + if "answer" in d: + return d.get("answer"), d.get("confidence"), True + except json.JSONDecodeError: + continue + return (text or "").strip()[:80], None, False + + +def _num(x): + if isinstance(x, bool): + return None + if isinstance(x, (int, float)): + return float(x) + m = re.search(r"-?\d+(?:\.\d+)?", str(x).replace(",", "")) + return float(m.group()) if m else None + + +def is_abstention(x) -> bool: + s = str(x).lower() + return any(k in s for k in ("cannot", "can't", "not determin", "unknown", "unreadable")) + + +def score(expected: dict, got) -> float: + """Same rules as the Harbor checker (tests/check.py).""" + t, a = expected["answer_type"], expected["answer"] + if got is None: + return 0.0 + if t == "abstain": + return 1.0 if is_abstention(got) else 0.0 + if t in ("number", "int"): + g = _num(got) + return 1.0 if g is not None and abs(g - float(a)) <= float(expected["tolerance"]) + 1e-9 else 0.0 + if t == "yesno": + return 1.0 if str(got).strip().lower().startswith(str(a)) else 0.0 + return 1.0 if str(got).strip().upper() == str(a).upper() else 0.0 + + +# ----------------------------------------------------------------------------- runner +def ask(model: str, task_dir: Path, cache_dir: Path, ledger: Ledger, blind: bool = False) -> dict: + task = json.loads((task_dir / "task.json").read_text()) + mode = "blind" if blind else "image" + cpath = cache_dir / model / f"{task['task_id']}__{mode}.json" + if cpath.exists(): + return {**json.loads(cpath.read_text()), "cached": True} + fam = json.loads((task_dir / "certificate.json").read_text()).get("family", "instruments") + prompt = PROMPT.format(scene=SCENE.get(fam, "an image"), fmt=FMT[task["answer_type"]], + question=task["question"]) + (BLIND_NOTE if blind else "") + png = None if blind else (task_dir / "image.png").read_bytes() + max_out = MAX_OUT.get(model, MAX_OUT["default"]) + ledger.reserve_check(model, 2600 if png else 400, max_out) + t0 = time.time() + err = None + for attempt in range(3): + try: + text, tin, tout, stop = ADAPTERS[PROVIDER[model]](model, png, prompt, max_out) + break + except Exception as e: # network / rate limit: back off; other errors are recorded + err = f"{type(e).__name__}: {str(e)[:300]}" + if any(s in err for s in ("429", "rate", "overloaded", "503", "500", "UNAVAILABLE", "timeout", "Timeout")): + time.sleep(5 * (attempt + 1)) + continue + text, tin, tout, stop = "", 0, 0, "error" + break + else: + text, tin, tout, stop = "", 0, 0, "error" + cost = ledger.add(model, tin, tout) if tin or tout else 0.0 + ans, conf, parsed = parse(text) + rec = {"task_id": task["task_id"], "model": model, "mode": mode, "raw": text[:2000], "answer": ans, + "confidence": conf, "parsed": parsed, "input_tokens": tin, "output_tokens": tout, + "cost_usd": round(cost, 6), "latency_s": round(time.time() - t0, 2), "stop": str(stop), + "error": err if stop == "error" else None, "prompt_version": "v2"} + if stop != "error": + cpath.parent.mkdir(parents=True, exist_ok=True) + cpath.write_text(json.dumps(rec, indent=2)) + return {**rec, "cached": False} + + +def run(run_dir: Path, models: list[str], task_ids: list[str] | None = None, blind: bool = False, + workers: int = 4, log=print) -> list[dict]: + _env() + run_dir = Path(run_dir) + ledger = Ledger() + dirs = sorted(p for p in (run_dir / "tasks").iterdir() if p.is_dir()) + if task_ids: + keep = set(task_ids) + dirs = [d for d in dirs if d.name in keep] + cache = run_dir / "eval" / "cache" + out = [] + for model in models: + done = 0 + with ThreadPoolExecutor(max_workers=workers) as ex: + futs = {ex.submit(ask, model, d, cache, ledger, blind): d for d in dirs} + for f in as_completed(futs): + d = futs[f] + try: + rec = f.result() + except BudgetExceeded as e: + log(f"BUDGET STOP {model}: {e}") + ex.shutdown(cancel_futures=True) + break + exp = json.loads((d / "answer.json").read_text()) + rec["correct"] = score(exp, rec["answer"]) + rec["op"] = json.loads((d / "certificate.json").read_text())["op"] + out.append(rec) + done += 1 + spent = {k: round(v, 4) for k, v in ledger.data["spent"].items()} + log(f"{model} ({'blind' if blind else 'image'}): {done} answered; ledger {spent}") + res_path = run_dir / "eval" / f"results_{'blind' if blind else 'image'}.jsonl" + res_path.parent.mkdir(parents=True, exist_ok=True) + with res_path.open("a") as fh: + for r in out: + fh.write(json.dumps({k: v for k, v in r.items() if k != "raw"}) + "\n") + return out diff --git a/needlepoint/factory.py b/needlepoint/factory.py new file mode 100644 index 0000000000000000000000000000000000000000..0a1f5688ae5923a178f4608ab26be23f05480022 --- /dev/null +++ b/needlepoint/factory.py @@ -0,0 +1,267 @@ +"""The task factory: sample → render → question program → gates → twin → package.""" +from __future__ import annotations + +import hashlib +import json +import time +from collections import Counter +from pathlib import Path + +import numpy as np + +from . import gates, ops +from . import panel as P +from .instruments.base import snap, value_grid +from .spec import Instrument, Panel + +DEFAULT_MIX = {"READ": 3, "THRESH": 3, "COMPARE": 2, "DIFF": 2, "COUNT_ALARM": 2, "SCALE": 1, "BIND": 2, "ABSTAIN": 1} + + +def _task_id(seed: int, op: str, salt: str = "") -> str: + return "np-" + hashlib.sha256(f"{seed}:{op}:{salt}".encode()).hexdigest()[:12] + + +def _set_alarm(inst: Instrument, want: bool, rng) -> bool: + """Resample the reading so that in_alarm() == want, keeping a decision margin. Returns success.""" + for _ in range(60): + if inst.kind == "digital": + step = 10 ** (-inst.scale.decimals) + v = snap(rng.uniform(inst.scale.vmin, inst.scale.vmax), step) + else: + v = value_grid(rng, inst.scale) + if inst.in_alarm(v) == want and inst.decision_margin_visual(v) >= gates.MARGIN[inst.kind] \ + and inst.decision_margin_units(v) >= inst.resolution(): + inst.value = v + return True + return False + + +def build(seed: int, op: str, profile: str = "industrial", difficulty: int = 2): + """Return (panel, question) or None if this seed cannot host the op.""" + rng = np.random.default_rng(seed + 7919) + n_by_d = {1: (1, 2), 2: (2, 3), 3: (3, 4), 4: (4, 6), 5: (5, 6)} + lo, hi = n_by_d[difficulty] + n = int(rng.integers(lo, hi + 1)) + if op in ("COMPARE", "DIFF"): + n = max(n, 2) + if op in ("COUNT_ALARM",): + n = max(n, 4) # >= 5 possible answers keeps the guessing floor low + if op == "BIND": + n = max(n, 3) + same = op in ("COMPARE", "DIFF", "BIND") + kinds = ["dial"] if op == "SCALE" else (["dial", "digital"] if op == "ABSTAIN" else None) + panel = P.sample_panel(seed, profile, n, kinds=kinds, same_scale=same, difficulty=difficulty) + idx = list(range(n)) + rng.shuffle(idx) + q = None + if op in ("READ", "BIND"): + for i in idx: + q = ops.read(panel, i, op) + if q: + break + elif op == "SCALE": + for i in idx: + q = ops.scale(panel, i) + if q: + break + elif op == "THRESH": + i = idx[0] + if not _set_alarm(panel.instruments[i], bool(rng.random() < 0.5), rng): + return None + q = ops.thresh(panel, i) + elif op == "COMPARE": + q = ops.compare(panel, idx[: min(len(idx), int(rng.integers(2, 4)))]) + elif op == "DIFF": + q = ops.diff(panel, idx[0], idx[1]) + elif op == "COUNT_ALARM": + k = int(rng.integers(0, n + 1)) + flags = [True] * k + [False] * (n - k) + rng.shuffle(flags) + for inst, f in zip(panel.instruments, flags): + if not _set_alarm(inst, f, rng): + return None + q = ops.count_alarm(panel) + elif op == "ABSTAIN": + cand = [i for i in idx if panel.instruments[i].kind in ("dial", "digital")] + if not cand: + return None + panel.instruments[cand[0]].covered = True + q = ops.abstain(panel, cand[0]) + return (panel, q) if q else None + + +def balance_key(panel: Panel, q: ops.Question): + """(group, value, universe) used to keep answers flat within each group, or None.""" + if q.op == "COUNT_ALARM": + n = len(panel.instruments) + return (f"COUNT_ALARM/n{n}", q.answer, list(range(n + 1))) + if q.op == "COMPARE": + tags = [panel.instruments[i].tag for i in q.targets] + return (f"COMPARE/k{len(tags)}", tags.index(q.answer), list(range(len(tags)))) + if q.op == "THRESH": + return ("THRESH", q.answer, ["yes", "no"]) + if q.op == "DIFF": + return ("DIFF/sign", bool(q.answer >= 0), [True, False]) + if q.op in ("READ", "BIND", "SCALE"): + x = panel.instruments[q.targets[0]] + return (f"{q.op}/scale_quartile", min(3, int(x.scale.fraction(x.value) * 4)), [0, 1, 2, 3]) + return None + + +class Balancer: + """Rejects a candidate if its answer bucket is already ahead of the least-filled bucket in its + group by more than `slack`. Keeps answer priors flat so text-only guessing stays at chance.""" + + def __init__(self, slack: int = 1): + self.slack, self.counts = slack, {} + + def ok(self, key) -> bool: + if key is None: + return True + group, val, uni = key + c = self.counts.setdefault(group, {u: 0 for u in uni}) + return c.get(val, 0) <= min(c.values()) + self.slack + + def add(self, key): + if key is not None: + group, val, uni = key + c = self.counts.setdefault(group, {u: 0 for u in uni}) + c[val] = c.get(val, 0) + 1 + + def report(self) -> dict: + return {g: {str(k): v for k, v in c.items()} for g, c in self.counts.items()} + + +def twin_of(panel: Panel, q: ops.Question, seed: int): + """Answer-flip counterfactual: minimal edit to the target reading that must change the answer.""" + if q.op != "THRESH": + return None + rng = np.random.default_rng(seed + 104729) + p2 = panel.model_copy(deep=True) + inst = p2.instruments[q.targets[0]] + if not _set_alarm(inst, not inst.in_alarm(), rng): + return None + q2 = ops.thresh(p2, q.targets[0]) + return p2, q2 + + +def signature(panel: Panel, q: ops.Question, difficulty: int) -> dict: + t = [panel.instruments[i] for i in q.targets] + return { + "op": q.op, "profile": panel.profile, "difficulty": difficulty, + "n_instruments": len(panel.instruments), + "target_kinds": sorted({x.kind for x in t}), + "scale_family": sorted({f"{x.kind}:{x.geom.get('sweep', '')}:{x.scale.minor_per}:{x.geom.get('label_every', 1)}" for x in t}), + "same_scale_distractors": len({x.scale.unit for x in panel.instruments}) == 1 and len(panel.instruments) > 1, + "steps": q.steps, + } + + +def surface(panel: Panel) -> dict: + return {"background": panel.background, + "styles": [{k: v for k, v in x.style.items()} for x in panel.instruments]} + + +def dhash(img, size: int = 8) -> str: + g = img.convert("L").resize((size + 1, size)) + a = np.asarray(g, dtype=np.int16) + bits = (a[:, 1:] > a[:, :-1]).flatten() + return f"{int(''.join('1' if b else '0' for b in bits), 2):016x}" + + +def write_task(out: Path, tid: str, panel: Panel, img, q: ops.Question, report: dict, difficulty: int, + twin_id: str | None = None, twin_of_id: str | None = None): + d = out / "tasks" / tid + d.mkdir(parents=True, exist_ok=True) + img.save(d / "image.png", optimize=False) + (d / "task.json").write_text(json.dumps({ + "task_id": tid, "image": "image.png", "question": q.text, "answer_type": q.answer_type, + "unit": q.unit, + }, indent=2)) + (d / "answer.json").write_text(json.dumps({ + "answer": q.answer, "answer_type": q.answer_type, "tolerance": q.tolerance, "unit": q.unit}, indent=2)) + cert = { + "task_id": tid, "op": q.op, "trace": q.trace, "steps": q.steps, + "generator": {"version": panel.generator_version, "seed": panel.seed}, + "spec_hash": panel.spec_hash(), "image_sha256": gates.img_hash(img), "dhash": dhash(img), + "gates": report["gates"], "decoder_reads": report["decoder_reads"], + "variation_signature": signature(panel, q, difficulty), "surface": surface(panel), + "twin": {"twin_id": twin_id, "twin_of": twin_of_id}, + "targets": [panel.instruments[i].tag for i in q.targets], + "spec": panel.model_dump(mode="json"), + } + (d / "certificate.json").write_text(json.dumps(cert, indent=2, default=str)) + return cert + + +def generate(out: Path, n: int, seed: int = 0, profile: str = "industrial", mix: dict | None = None, + difficulties=(1, 2, 3, 4), twins: bool = True, balance: bool = True, log=print) -> dict: + out = Path(out) + (out / "tasks").mkdir(parents=True, exist_ok=True) + mix = mix or DEFAULT_MIX + rng = np.random.default_rng(seed) + op_list = [op for op, w in mix.items() for _ in range(w)] + accepted, rejections, candidates = [], [], 0 + seen = set() + bal = Balancer() if balance else None + balance_skips = 0 + t0 = time.perf_counter() + k = 0 + while len(accepted) < n and k < n * 60: + k += 1 + op = op_list[rng.integers(len(op_list))] + diff_ = int(rng.choice(difficulties)) + cseed = seed * 1_000_000 + k + built = build(cseed, op, profile, diff_) + if built is None: + continue + panel, q = built + bkey = balance_key(panel, q) + if bal and not bal.ok(bkey): + balance_skips += 1 # sampling decision, not a validity failure + continue + candidates += 1 + img = P.render(panel) + rep = gates.run_all(panel, img, q) + if not rep["passed"]: + rejections.append({"seed": cseed, "op": op, "failed": rep["failed"], + "detail": {g: rep["gates"][g]["detail"] for g in rep["failed"]}}) + continue + sig = json.dumps(signature(panel, q, diff_), sort_keys=True) + dhash(img) + if sig in seen: + rejections.append({"seed": cseed, "op": op, "failed": ["G7_duplicate"], "detail": {}}) + continue + seen.add(sig) + tid = _task_id(cseed, op) + twin_id = None + if twins and q.op == "THRESH": + tw = twin_of(panel, q, cseed) + if tw: + p2, q2 = tw + img2 = P.render(p2) + rep2 = gates.run_all(p2, img2, q2) + if rep2["passed"]: + if bal: + bal.add(balance_key(p2, q2)) + twin_id = _task_id(cseed, op, "twin") + write_task(out, twin_id, p2, img2, q2, rep2, diff_, twin_of_id=tid) + accepted.append({"task_id": twin_id, "op": q2.op, "twin_of": tid}) + write_task(out, tid, panel, img, q, rep, diff_, twin_id=twin_id) + accepted.append({"task_id": tid, "op": q.op, "twin_id": twin_id}) + if bal: + bal.add(bkey) + dt = time.perf_counter() - t0 + fail_counts = Counter(g for r in rejections for g in r["failed"]) + metrics = { + "seed": seed, "profile": profile, "requested": n, "accepted": len(accepted), + "candidates": candidates, "acceptance_rate": round(len(accepted) / max(1, candidates + sum(1 for a in accepted if a.get("twin_of"))), 4), + "rejections": len(rejections), "rejections_by_gate": dict(fail_counts), + "ops": dict(Counter(a["op"] for a in accepted)), "twins": sum(1 for a in accepted if a.get("twin_of")), + "seconds": round(dt, 2), "tasks_per_second": round(len(accepted) / dt, 2), + "balance_skips": balance_skips, "answer_balance": bal.report() if bal else None, + } + (out / "manifest.jsonl").write_text("\n".join(json.dumps(a) for a in accepted) + "\n") + (out / "rejection_log.jsonl").write_text("\n".join(json.dumps(r) for r in rejections) + "\n") + (out / "metrics.json").write_text(json.dumps(metrics, indent=2)) + log(json.dumps(metrics, indent=2)) + return metrics diff --git a/needlepoint/faults.py b/needlepoint/faults.py new file mode 100644 index 0000000000000000000000000000000000000000..573c3cc37a8a0c3bd7a8a0c921104449176c4b86 --- /dev/null +++ b/needlepoint/faults.py @@ -0,0 +1,160 @@ +"""Verifier-of-verifiers. + +1. Gate fault injection: plant known defects in otherwise-valid candidates and measure, + per defect class, how often the gate chain rejects them (recall) — and how often it + rejects clean candidates (false rejection). +2. Checker mutation tests: run the *actual* Harbor answer checker against correct, + near-correct and deliberately wrong answers. +""" +from __future__ import annotations + +import json +import os +import subprocess +import sys +import tempfile +from collections import Counter +from pathlib import Path + +import numpy as np + +from . import gates, ops +from . import panel as P +from .factory import build +from .fonts import cmap +from .harbor_export import TEST_PY + +INTENDED = { + "occluded": "G3_visibility", "illegible": "G2_legibility", "near_threshold": "G5_margin", + "wrong_key": "G4_decoder", "leak": "G6_leak", "missing_glyph": "G1_glyphs", +} + + +def _missing_char() -> str: + cm = cmap() + for cp in (0x2BD1, 0x1F6A7, 0x2B8C, 0x2E3B, 0xA9DF): + if cp not in cm: + return chr(cp) + raise RuntimeError("no uncovered glyph found") + + +def inject(kind: str, seed: int, rng): + """Return (panel, img, question, overrides) carrying exactly one planted defect, or None.""" + op = "THRESH" if kind == "near_threshold" else str(rng.choice(["READ", "THRESH", "BIND"])) + built = build(seed, op, "industrial", int(rng.integers(1, 4))) + if not built: + return None + panel, q = built + i = q.targets[0] + inst = panel.instruments[i] + ov = {} + if kind == "occluded": + ov = {i: {"occlude": True}} + elif kind == "illegible": + face = inst.style.get("face", inst.style.get("plate", (238, 238, 230))) + ov = {i: {"label_px": int(rng.integers(6, 9)), "label_rgb": tuple(max(0, c - 40) for c in face)}} + if inst.kind == "digital": + ov = {i: {"label_px": 7, "label_rgb": (70, 72, 78)}} + elif kind == "near_threshold": + edges = [e for b in inst.bands for e in (b.lo, b.hi) if inst.scale.vmin < e < inst.scale.vmax] + if not edges: + return None + e = edges[0] + inst.value = round(e + rng.choice([-1, 1]) * 0.25 * inst.resolution(), 9) + q = ops.thresh(panel, i) + elif kind == "wrong_key": + delta = 3 * inst.resolution() * rng.choice([-1, 1]) + rv = min(max(inst.value + delta, inst.scale.vmin), inst.scale.vmax) + if abs(rv - inst.value) < 2 * inst.resolution(): + rv = inst.value - delta + ov = {i: {"render_value": rv}} + elif kind == "leak": + if q.answer_type == "number": + q.text = q.text.replace("?", f" (it is about {q.answer:g})?") + else: + q.text = q.text + f" (Hint: the answer is {q.answer}.)" + elif kind == "missing_glyph": + ov = {i: {"unit_text": inst.scale.unit + " " + _missing_char()}} + img = P.render(panel, ov) + return panel, img, q, ov + + +def gate_fault_suite(n_per_class: int = 60, n_clean: int = 200, seed: int = 7) -> dict: + rng = np.random.default_rng(seed) + res = {"classes": {}, "clean": {}} + k = 0 + for kind in INTENDED: + caught = intended = total = 0 + reasons = Counter() + while total < n_per_class: + k += 1 + got = inject(kind, 50_000_000 + k, rng) + if not got: + continue + panel, img, q, ov = got + rep = gates.run_all(panel, img, q, ov) + total += 1 + caught += not rep["passed"] + intended += INTENDED[kind] in rep["failed"] + reasons.update(rep["failed"]) + res["classes"][kind] = {"n": total, "recall_any_gate": round(caught / total, 4), + "recall_intended_gate": round(intended / total, 4), + "intended_gate": INTENDED[kind], "rejections_by_gate": dict(reasons)} + rej = 0 + reasons = Counter() + total = 0 + while total < n_clean: + k += 1 + op = str(rng.choice(["READ", "THRESH", "BIND", "COMPARE", "DIFF", "COUNT_ALARM"])) + built = build(60_000_000 + k, op, "industrial", int(rng.integers(1, 5))) + if not built: + continue + panel, q = built + rep = gates.run_all(panel, P.render(panel), q) + total += 1 + rej += not rep["passed"] + reasons.update(rep["failed"]) + res["clean"] = {"n": total, "false_rejection_rate": round(rej / total, 4), "rejections_by_gate": dict(reasons)} + return res + + +def _run_checker(expected: dict, answer) -> float: + with tempfile.TemporaryDirectory() as td: + td = Path(td) + (td / "expected.json").write_text(json.dumps(expected)) + (td / "art").mkdir() + if answer is not None: + (td / "art" / "answer.json").write_text(json.dumps({"answer": answer})) + (td / "check.py").write_text(TEST_PY) + env = {**os.environ, "NP_EXPECTED": str(td / "expected.json"), "NP_ARTIFACTS": str(td / "art"), + "NP_APP_ANSWER": str(td / "none.json"), "NP_REWARD": str(td / "reward.txt")} + subprocess.run([sys.executable, "-I", str(td / "check.py")], env=env, capture_output=True, check=True) + return float((td / "reward.txt").read_text()) + + +def checker_mutation_suite(run_dir: Path, limit: int = 60) -> dict: + """For each task: correct -> 1, within-tolerance -> 1, off-by-wrong -> 0, missing -> 0.""" + rows = [] + for d in sorted((Path(run_dir) / "tasks").iterdir())[:limit]: + exp = json.loads((d / "answer.json").read_text()) + a, t, tol = exp["answer"], exp["answer_type"], exp["tolerance"] + cases = [("correct", a if t != "abstain" else "cannot determine", 1.0), ("missing", None, 0.0)] + if t == "number": + res = tol * 2 if tol > 0 else 1 + cases += [("within_tol", a + 0.9 * tol, 1.0), ("one_step_off", a + 2.2 * tol + 1e-6, 0.0), + ("sign_or_scale_slip", a * 10 + res, 0.0), ("as_text", f"{a} units", 1.0)] + elif t == "int": + cases += [("plus_one", a + 1, 0.0), ("minus_one", a - 1, 0.0) if a > 0 else ("plus_two", a + 2, 0.0)] + elif t == "yesno": + cases += [("flipped", "no" if a == "yes" else "yes", 0.0), ("capitalised", str(a).upper(), 1.0)] + elif t == "tag": + cases += [("other_tag", "XX-000", 0.0), ("lowercase", str(a).lower(), 1.0)] + elif t == "abstain": + cases += [("hallucinated_number", 42.0, 0.0), ("phrased", "It cannot be determined", 1.0)] + for name, ans, want in cases: + got = _run_checker(exp, ans) + rows.append({"task": d.name, "type": t, "case": name, "expected_reward": want, "reward": got, "ok": got == want}) + by = Counter((r["case"], r["ok"]) for r in rows) + return {"n_checks": len(rows), "all_ok": all(r["ok"] for r in rows), + "failures": [r for r in rows if not r["ok"]][:20], + "by_case": {f"{c}:{'ok' if ok else 'FAIL'}": v for (c, ok), v in sorted(by.items())}} diff --git a/needlepoint/fonts.py b/needlepoint/fonts.py new file mode 100644 index 0000000000000000000000000000000000000000..e96aac51a604059b371c4c210dca60337222d10a --- /dev/null +++ b/needlepoint/fonts.py @@ -0,0 +1,35 @@ +"""Bundled fonts (DejaVu, Bitstream Vera licence) and glyph-coverage checks. + +Bundling the font makes rendering deterministic across machines and lets the +image-only decoder build OCR templates from the *font*, never from task values. +""" +from __future__ import annotations + +from functools import lru_cache +from pathlib import Path + +from fontTools.ttLib import TTFont +from PIL import ImageFont + +FONT_DIR = Path(__file__).resolve().parent / "fonts" +FONTS = { + "sans": FONT_DIR / "DejaVuSans.ttf", + "bold": FONT_DIR / "DejaVuSans-Bold.ttf", + "mono": FONT_DIR / "DejaVuSansMono.ttf", +} + + +@lru_cache(maxsize=256) +def font(size: int, face: str = "sans") -> ImageFont.FreeTypeFont: + return ImageFont.truetype(str(FONTS[face]), size=size) + + +@lru_cache(maxsize=8) +def cmap(face: str = "sans") -> frozenset[int]: + return frozenset(TTFont(str(FONTS[face])).getBestCmap().keys()) + + +def missing_glyphs(text: str, face: str = "sans") -> list[str]: + """Characters in `text` that the bundled font cannot draw (would render as tofu).""" + cm = cmap(face) + return sorted({ch for ch in text if not ch.isspace() and ord(ch) not in cm}) diff --git a/needlepoint/fonts/DejaVuSans-Bold.ttf b/needlepoint/fonts/DejaVuSans-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..39699bd84ae17507955ce571caa859ad14997f4e --- /dev/null +++ b/needlepoint/fonts/DejaVuSans-Bold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b184b89e3c1075f22f6b71575b6fc20d4972b3cfd3b23322ca6fd596dcaef167 +size 704128 diff --git a/needlepoint/fonts/DejaVuSans.ttf b/needlepoint/fonts/DejaVuSans.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f47aa8cffd396d3ac221ad7a2a518bc9a554c9ce --- /dev/null +++ b/needlepoint/fonts/DejaVuSans.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fdf69cabf06049ea70a00b5919340e2ce1e6d02b0cc3c4b44fb6801bd1e0d22 +size 756072 diff --git a/needlepoint/fonts/DejaVuSansMono.ttf b/needlepoint/fonts/DejaVuSansMono.ttf new file mode 100644 index 0000000000000000000000000000000000000000..60f42148ea53bf551fc77faef9d6382ff0efcb16 --- /dev/null +++ b/needlepoint/fonts/DejaVuSansMono.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:602ec86b8948cfcd956482fe64f94c36c867770149ef2f791d4613f443bcecb3 +size 340240 diff --git a/needlepoint/fonts/LICENSE_DEJAVU b/needlepoint/fonts/LICENSE_DEJAVU new file mode 100644 index 0000000000000000000000000000000000000000..254e2cc42a6d0135cccf2047768b9e44f25e666f --- /dev/null +++ b/needlepoint/fonts/LICENSE_DEJAVU @@ -0,0 +1,99 @@ +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ diff --git a/needlepoint/gates.py b/needlepoint/gates.py new file mode 100644 index 0000000000000000000000000000000000000000..4781ae31c4a03f4aea5e49d1ebde1f74e15155e9 --- /dev/null +++ b/needlepoint/gates.py @@ -0,0 +1,158 @@ +"""Validation gates. Each gate returns (passed, detail). A task is accepted only if all pass. + +G0 determinism re-render from spec reproduces identical pixels +G1 glyphs every printed string is covered by the bundled font +G2 legibility label size and contrast (WCAG ratio of rendered colours) above thresholds +G3 visibility evidence pixels of target instruments are not altered by anything else drawn +G4 decoder image-only decoder agrees with the spec answer within tolerance +G5 margin decision questions keep a visual margin from alarm boundaries / ties +G6 leak the answer is not recoverable from the question text +""" +from __future__ import annotations + +import hashlib +import re + +import numpy as np + +from . import panel as P +from .fonts import missing_glyphs +from .ops import Question +from .spec import Panel + +MIN_LABEL_PX = 11 +MIN_CONTRAST = 4.5 +MARGIN = {"dial": 6.0, "linear": 3.0, "digital": 2.0} # degrees / % of length / display steps + + +def _lum(c): + ch = [x / 255 for x in c] + ch = [x / 12.92 if x <= 0.03928 else ((x + 0.055) / 1.055) ** 2.4 for x in ch] + return 0.2126 * ch[0] + 0.7152 * ch[1] + 0.0722 * ch[2] + + +def contrast(c1, c2) -> float: + a, b = sorted([_lum(c1), _lum(c2)], reverse=True) + return (a + 0.05) / (b + 0.05) + + +def img_hash(img) -> str: + return hashlib.sha256(np.asarray(img).tobytes()).hexdigest() + + +def g0_determinism(panel: Panel, img, overrides) -> tuple[bool, str]: + return (img_hash(P.render(panel, overrides)) == img_hash(img), "re-render identical") + + +def g1_glyphs(panel: Panel, overrides) -> tuple[bool, str]: + texts = [] + for i, x in enumerate(panel.instruments): + o = (overrides or {}).get(i, {}) + texts += [x.tag, o.get("unit_text", x.scale.unit)] + [x.scale.fmt(v) for v in x.scale.major_values()] + miss = sorted({m for t in texts for m in missing_glyphs(t)}) + return (not miss, f"missing={miss}" if miss else "all glyphs covered") + + +def g2_legibility(panel: Panel, q: Question, overrides) -> tuple[bool, str]: + for i in q.targets: + x = panel.instruments[i] + o = (overrides or {}).get(i, {}) + px = o.get("label_px", P.KINDS[x.kind].label_px(x)) + if x.kind == "digital": + fg, bg = o.get("label_rgb", (235, 235, 235)), P.digital.LABEL_STRIP + else: + fg, bg = o.get("label_rgb", x.style["ink"]), x.style.get("face", x.style.get("plate")) + c = contrast(fg, bg) + if px < MIN_LABEL_PX or c < MIN_CONTRAST: + return False, f"{x.tag}: label {px}px contrast {c:.1f}" + return True, "labels legible" + + +def g3_visibility(panel: Panel, img, q: Question, overrides) -> tuple[bool, str]: + arr = np.asarray(img).astype(np.int16) + for i in q.targets: + x = panel.instruments[i] + if x.covered: + continue + ref = np.asarray(P.render(panel, None, only=i)).astype(np.int16) + m = P.KINDS[x.kind].evidence_mask(x, (panel.width, panel.height)) + if m.sum() == 0: + return False, f"{x.tag}: empty evidence mask" + same = (np.abs(arr[m] - ref[m]).sum(axis=1) < 30).mean() + if same < 0.95: + return False, f"{x.tag}: evidence {same:.0%} unaltered" + return True, "evidence unoccluded" + + +def g4_decoder(panel: Panel, img, q: Question) -> tuple[bool, str, dict]: + reads = {} + for i in q.targets: + x = panel.instruments[i] + d = P.decode(img, x) + reads[x.tag] = {"ok": d.ok, "value": d.value, "alarm": d.alarm, "reason": d.reason} + if x.covered: + if d.ok and d.value is not None: + return False, f"{x.tag}: covered indicator still decodable", reads + continue + if not d.ok or d.value is None: + return False, f"{x.tag}: decoder failed ({d.reason})", reads + if abs(d.value - x.value) > x.tolerance(): + return False, f"{x.tag}: decoder {d.value:.4g} vs spec {x.value:.4g}", reads + if q.op in ("THRESH", "COUNT_ALARM") and d.alarm is not None and d.alarm != x.in_alarm(): + return False, f"{x.tag}: decoder alarm {d.alarm} vs spec {x.in_alarm()}", reads + return True, "decoder agrees", reads + + +def g5_margin(panel: Panel, q: Question) -> tuple[bool, str]: + insts = [panel.instruments[i] for i in q.targets] + if q.op in ("THRESH", "COUNT_ALARM"): + for x in insts: + mv = x.decision_margin_visual() + if mv < MARGIN[x.kind] or x.decision_margin_units() < x.resolution(): + return False, f"{x.tag}: margin {mv:.1f} below {MARGIN[x.kind]}" + if q.op == "COMPARE": + vals = sorted((x.value for x in insts), reverse=True) + need = 2 * max(x.resolution() for x in insts) + if vals[0] - vals[1] < need: + return False, f"top-two gap {vals[0] - vals[1]:.4g} < {need:.4g}" + return True, "margins ok" + + +def g6_leak(q: Question) -> tuple[bool, str]: + t = q.text.lower() + a = q.answer + if q.answer_type in ("number", "int"): + if re.search(rf"(? tuple[bool, str]: + """Red is reserved for alarm meaning: no needle, fill or digit colour may look like the alarm band.""" + from .catalog import BAND + for x in panel.instruments: + for key in ("needle", "fill", "seg"): + c = x.style.get(key) + if c and sum(abs(a - b) for a, b in zip(c, BAND)) < 150 or (c and c[0] > 170 and c[1] < 110 and c[2] < 110): + return False, f"{x.tag}: {key} colour {tuple(c)} confusable with alarm red" + return True, "red reserved for alarm bands" + + +def run_all(panel: Panel, img, q: Question, overrides=None) -> dict: + res = {} + res["G0_determinism"] = g0_determinism(panel, img, overrides) + res["G1_glyphs"] = g1_glyphs(panel, overrides) + res["G2_legibility"] = g2_legibility(panel, q, overrides) + res["G3_visibility"] = g3_visibility(panel, img, q, overrides) + ok4, msg4, reads = g4_decoder(panel, img, q) + res["G4_decoder"] = (ok4, msg4) + res["G5_margin"] = g5_margin(panel, q) + res["G6_leak"] = g6_leak(q) + res["G8_reserved_red"] = g8_reserved_red(panel) + passed = all(v[0] for v in res.values()) + return {"passed": passed, "gates": {k: {"pass": v[0], "detail": v[1]} for k, v in res.items()}, + "decoder_reads": reads, "failed": [k for k, v in res.items() if not v[0]]} diff --git a/needlepoint/harbor_export.py b/needlepoint/harbor_export.py new file mode 100644 index 0000000000000000000000000000000000000000..ca90c7115ba031c71f71dc227d1289fb5e98ac97 --- /dev/null +++ b/needlepoint/harbor_export.py @@ -0,0 +1,145 @@ +"""Export NEEDLEPOINT tasks as Harbor 0.25.x task packages. + +Each visual task becomes a containerised Harbor task: + instruction.md the only thing the evaluated agent sees (question + answer format) + environment/ Dockerfile + the panel image (no answers, no spec) + solution/ solve.sh writing the reference answer (used by the oracle agent) + tests/ separate-verifier image with test.sh + expected.json; writes the reward + task.toml metadata incl. generator provenance and licence + +Validation matrix (as in the organizer guide): nop -> 0.0, oracle -> 1.0. +""" +from __future__ import annotations + +import json +import shutil +from pathlib import Path + +BASE_IMAGE = "python@sha256:e70237b264442328526ff29d6b3c43bd8abcf6cbab78a949322fb69b7d91d6b6" # python:3.12-slim + +ANSWER_HELP = { + "number": 'a number, e.g. {"answer": 12.5}', + "int": 'an integer, e.g. {"answer": 2}', + "yesno": '"yes" or "no", e.g. {"answer": "no"}', + "tag": 'the instrument tag exactly as printed, e.g. {"answer": "PT-101"}', + "abstain": 'a number, e.g. {"answer": 12.5}', +} + +TEST_PY = r''' +import json, math, os, pathlib, re, sys +exp = json.load(open(os.environ.get("NP_EXPECTED", "/tests/expected.json"))) +art = pathlib.Path(os.environ.get("NP_ARTIFACTS", "/logs/artifacts")) +cands = [art / "answer.json", *art.rglob("answer.json"), pathlib.Path(os.environ.get("NP_APP_ANSWER", "/app/answer.json"))] +got, reward = None, 0.0 +for p in cands: + if p.is_file(): + try: + got = json.loads(p.read_text())["answer"]; break + except Exception as e: + print("unreadable answer file", p, e) +t, a = exp["answer_type"], exp["answer"] +def num(x): + if isinstance(x, (int, float)): return float(x) + m = re.search(r"-?\d+(?:\.\d+)?", str(x).replace(",", "")) + return float(m.group()) if m else None +if got is None: + reward = 0.0 +elif t == "abstain": + s = str(got).lower() + reward = 1.0 if ("cannot" in s or "can't" in s or "not determin" in s or "unknown" in s) else 0.0 +elif t in ("number", "int"): + g = num(got) + reward = 1.0 if g is not None and abs(g - float(a)) <= float(exp["tolerance"]) + 1e-9 else 0.0 +elif t == "yesno": + reward = 1.0 if str(got).strip().lower().startswith(str(a)) else 0.0 +else: + reward = 1.0 if str(got).strip().upper() == str(a).upper() else 0.0 +out = pathlib.Path(os.environ.get("NP_REWARD", "/logs/verifier/reward.txt")) +out.parent.mkdir(parents=True, exist_ok=True) +out.write_text(str(reward)) +print("expected", a, "got", got, "reward", reward) +''' + + +def instruction(task: dict) -> str: + return ( + "Look at the image at `/app/panel.png`.\n\n" + f"{task['question']}\n\n" + "If the value cannot be determined from the image, answer \"cannot determine\".\n\n" + f"Write your final answer as JSON to `/app/answer.json`, where `answer` is {ANSWER_HELP[task['answer_type']]}\n" + ) + + +def export_task(task_dir: Path, out_root: Path, license_id: str = "MIT") -> Path: + task = json.loads((task_dir / "task.json").read_text()) + ans = json.loads((task_dir / "answer.json").read_text()) + cert = json.loads((task_dir / "certificate.json").read_text()) + tid = task["task_id"] + d = out_root / tid + if d.exists(): + shutil.rmtree(d) + (d / "environment").mkdir(parents=True) + (d / "solution").mkdir() + (d / "tests").mkdir() + shutil.copy(task_dir / "image.png", d / "environment" / "panel.png") + (d / "environment" / "Dockerfile").write_text(f"FROM {BASE_IMAGE}\nWORKDIR /app\nCOPY panel.png /app/panel.png\n") + (d / "instruction.md").write_text(instruction(task)) + sol = ans["answer"] if ans["answer_type"] != "abstain" else "cannot determine" + (d / "solution" / "solve.sh").write_text("#!/bin/bash\nset -e\n" + f"cat > /app/answer.json <<'EOF'\n{json.dumps({'answer': sol})}\nEOF\n") + (d / "tests" / "expected.json").write_text(json.dumps({**ans}, indent=2)) + (d / "tests" / "check.py").write_text(TEST_PY) + (d / "tests" / "test.sh").write_text("#!/bin/bash\npython3 /tests/check.py\n") + (d / "tests" / "Dockerfile").write_text(f"FROM {BASE_IMAGE}\nWORKDIR /app\nCOPY . /tests/\n") + for f in ("solution/solve.sh", "tests/test.sh"): + (d / f).chmod(0o755) + sig = cert["variation_signature"] + toml = f'''schema_version = "1.4" +artifacts = ["/app/answer.json"] + +[task] +name = "needlepoint/{tid}" +version = "1.0.0" +description = "NEEDLEPOINT visual task ({sig['op']}, {cert.get('family', 'instruments')}): answer a question grounded in the image." +authors = [] +keywords = ["visual", "needlepoint", "{cert.get('family', 'instruments')}", "{sig['op'].lower()}"] + +[metadata] +generator = "needlepoint" +generator_version = "{cert['generator']['version']}" +generator_seed = {cert['generator']['seed']} +spec_hash = "{cert['spec_hash']}" +image_sha256 = "{cert['image_sha256']}" +op = "{sig['op']}" +difficulty = {sig['difficulty']} +license = "{license_id}" + +[verifier] +timeout_sec = 120.0 +environment_mode = "separate" +collect = [] + +[verifier.env] + +[agent] +timeout_sec = 600.0 + +[environment] +network_mode = "public" +build_timeout_sec = 600.0 +os = "linux" +mcp_servers = [] + +[environment.env] + +[solution.env] +''' + (d / "task.toml").write_text(toml) + return d + + +def export_all(run_dir: Path, out_root: Path | None = None, limit: int | None = None) -> list[Path]: + run_dir = Path(run_dir) + out_root = Path(out_root or run_dir / "harbor") + out_root.mkdir(parents=True, exist_ok=True) + dirs = sorted(p for p in (run_dir / "tasks").iterdir() if p.is_dir()) + return [export_task(p, out_root) for p in dirs[:limit]] diff --git a/needlepoint/humancheck.py b/needlepoint/humancheck.py new file mode 100644 index 0000000000000000000000000000000000000000..1406b8deb549d36e6aa9d17166bf0c11237ee7e9 --- /dev/null +++ b/needlepoint/humancheck.py @@ -0,0 +1,63 @@ +"""Blind human hand-check: a self-contained local HTML page (no answers inside, nothing uploaded). + +The reader answers N tasks; the page shows a JSON blob to paste into +`runs//human_check/answers.json`; `score_human()` grades it with the same checker rules. +""" +from __future__ import annotations + +import base64 +import html +import json +import random +from pathlib import Path + +from .evaluate import score + +PAGE = """ +NEEDLEPOINT hand-check + +

NEEDLEPOINT blind hand-check ({n} tasks)

+

Answer from the image only. Numbers without units. Type cannot determine if the value is not readable. +Answers are kept only in this browser tab. When done, press Show results, then copy the JSON into +answers.json next to this file.

+{items} + +""" + + +def build_page(run_dir: Path, n: int = 30, seed: int = 5) -> Path: + run_dir = Path(run_dir) + dirs = sorted(p for p in (run_dir / "tasks").iterdir() if p.is_dir()) + random.Random(seed).shuffle(dirs) + pick = dirs[:n] + items = [] + for k, d in enumerate(pick, 1): + t = json.loads((d / "task.json").read_text()) + b64 = base64.b64encode((d / "image.png").read_bytes()).decode() + items.append(f'
{k}.
{html.escape(t["question"])}
' + f'instrument panel {k}' + f'

') + out = run_dir / "human_check" + out.mkdir(exist_ok=True) + (out / "index.html").write_text(PAGE.format(n=len(pick), items="\n".join(items))) + (out / "task_ids.json").write_text(json.dumps([d.name for d in pick])) + return out / "index.html" + + +def score_human(run_dir: Path) -> dict: + run_dir = Path(run_dir) + ans = json.loads((run_dir / "human_check" / "answers.json").read_text()) + rows = [] + for tid, got in ans.items(): + exp = json.loads((run_dir / "tasks" / tid / "answer.json").read_text()) + rows.append({"task_id": tid, "expected": exp["answer"], "got": got, "correct": score(exp, got if got != "" else None)}) + k = sum(r["correct"] for r in rows) + res = {"n": len(rows), "correct": k, "accuracy": round(k / max(1, len(rows)), 4), + "misses": [r for r in rows if r["correct"] < 1]} + (run_dir / "human_check" / "score.json").write_text(json.dumps(res, indent=2)) + return res diff --git a/needlepoint/hunt.py b/needlepoint/hunt.py new file mode 100644 index 0000000000000000000000000000000000000000..a8ef3265cb7cb4f893ec22aedfbb398afe2041ca --- /dev/null +++ b/needlepoint/hunt.py @@ -0,0 +1,165 @@ +"""Bounded frontier hunt (EXP-05): three candidate difficulty axes, each at two levels. + +WIRES trace a wire between terminal blocks through crossings (patch panels, harnesses) +COUNT exact count of red boxes among many on warehouse shelves (inventory) +PERSP read a dial photographed at an oblique angle (robot / phone capture) +Answers are computed from the generator; each family has a validity check. +""" +from __future__ import annotations + +import hashlib +import json +from pathlib import Path + +import numpy as np +from PIL import Image, ImageDraw + +from . import catalog +from .fonts import font +from .instruments import dial + +W, H = 1024, 768 + + +def _save(out: Path, fam: str, level: str, seed: int, img, q: str, ans, atype: str, tol: float = 0.0, meta=None): + tid = f"h-{fam.lower()}-" + hashlib.sha256(f"{fam}:{level}:{seed}".encode()).hexdigest()[:10] + d = out / "tasks" / tid + d.mkdir(parents=True, exist_ok=True) + img.save(d / "image.png") + (d / "task.json").write_text(json.dumps({"task_id": tid, "image": "image.png", "question": q, "answer_type": atype, "unit": ""})) + (d / "answer.json").write_text(json.dumps({"answer": ans, "answer_type": atype, "tolerance": tol, "unit": ""})) + (d / "certificate.json").write_text(json.dumps({"task_id": tid, "op": f"{fam}_{level}", "family": fam, "level": level, + "seed": seed, "meta": meta or {}, "targets": []}, default=float)) + return tid + + +# ----------------------------------------------------------------------------- WIRES +def _bezier(p0, p1, p2, p3, n=240): + t = np.linspace(0, 1, n)[:, None] + return (1 - t) ** 3 * p0 + 3 * (1 - t) ** 2 * t * p1 + 3 * (1 - t) * t ** 2 * p2 + t ** 3 * p3 + + +def wires(seed: int, n: int, cols: int = 4): + """Braid construction: at each of `cols` interior columns every wire occupies one slot of an + evenly spaced grid (a random permutation); between columns wires move with cosine easing. + Wires never run alongside each other and every crossing is steep, so tracing is well defined.""" + rng = np.random.default_rng(seed) + ys = np.linspace(110, H - 110, n) + xs = np.linspace(150, W - 150, cols + 2) + slots = [np.arange(n)] + [rng.permutation(n) for _ in range(cols)] + final = rng.permutation(n) + slots.append(final) + curves = [] + for i in range(n): + pts = [] + for c in range(len(xs) - 1): + ya, yb = ys[slots[c][i]], ys[slots[c + 1][i]] + t = np.linspace(0, 1, 60, endpoint=False) + e = (1 - np.cos(np.pi * t)) / 2 + pts.append(np.stack([xs[c] + t * (xs[c + 1] - xs[c]), ya + e * (yb - ya)], axis=1)) + pts.append(np.array([[xs[-1], ys[slots[-1][i]]]])) + curves.append(np.concatenate(pts)) + perm = final + img = Image.new("RGB", (W, H), (236, 236, 232)) + d = ImageDraw.Draw(img) + for x in (110, W - 110): + d.rounded_rectangle([x - 40, 70, x + 40, H - 70], radius=8, fill=(70, 74, 80)) + col = (30, 30, 30) + for c in curves: + d.line([tuple(p) for p in c], fill=col, width=4, joint="curve") + for i in range(n): + d.ellipse([140, ys[i] - 8, 156, ys[i] + 8], fill=(200, 170, 60)) + d.ellipse([W - 156, ys[i] - 8, W - 140, ys[i] + 8], fill=(200, 170, 60)) + d.text((110, ys[i]), f"L{i + 1}", fill=(250, 250, 250), font=font(16, "bold"), anchor="mm") + d.text((W - 110, ys[i]), f"R{i + 1}", fill=(250, 250, 250), font=font(16, "bold"), anchor="mm") + k = int(rng.integers(n)) + return img, f"Follow the wire that starts at terminal L{k + 1}. At which right-side terminal does it end? Answer with the label (e.g. R3).", f"R{perm[k] + 1}" + + +# ----------------------------------------------------------------------------- COUNT +def shelves(seed: int, lo: int, hi: int): + rng = np.random.default_rng(seed) + img = Image.new("RGB", (W, H), (214, 208, 198)) + d = ImageDraw.Draw(img) + rows = 4 + shelf_y = np.linspace(150, H - 40, rows) + target = int(rng.integers(lo, hi + 1)) + n_red = 0 + items = [] + for r, y in enumerate(shelf_y): + d.rectangle([40, y, W - 40, y + 10], fill=(110, 80, 50)) + x = 50 + while x < W - 90: + w = int(rng.integers(22, 46)); h = int(rng.integers(30, 95)) + if x + w > W - 50: + break + items.append((x, y - h, x + w, y - 1)) + x += w + int(rng.integers(3, 12)) + rng.shuffle(items) + red_idx = set(range(min(target, len(items)))) + palette = [(70, 110, 170), (90, 150, 90), (200, 170, 80), (150, 150, 150), (180, 120, 70)] + for i, (x0, y0, x1, y1) in enumerate(items): + c = (205, 40, 40) if i in red_idx else palette[int(rng.integers(len(palette)))] + d.rectangle([x0, y0, x1, y1], fill=c, outline=(40, 40, 40), width=1) + n_red += i in red_idx + return img, "How many red boxes are on the shelves in total? Answer with an exact integer.", int(n_red), len(items) + + +# ----------------------------------------------------------------------------- PERSP +def _coeffs(src, dst): + """PIL perspective coefficients mapping output (dst) -> input (src).""" + A, b = [], [] + for (x, y), (u, v) in zip(dst, src): + A += [[x, y, 1, 0, 0, 0, -u * x, -u * y], [0, 0, 0, x, y, 1, -v * x, -v * y]] + b += [u, v] + return np.linalg.solve(np.array(A, float), np.array(b, float)).tolist() + + +def persp(seed: int, angle: float): + rng = np.random.default_rng(seed) + entry = [e for e in catalog.INDUSTRIAL if e[8] == 1][int(rng.integers(0, 17))] + inst = dial.sample(rng, entry, "PT-" + str(int(rng.integers(101, 999))), 3) + inst.box = (212, 40, 812, 740) + img = Image.new("RGB", (W, H), (88, 96, 104)) + dial.render(img, inst) + # oblique view: shrink one side (rotation about the vertical axis) + slight tilt + s = np.sin(np.radians(angle)) + side = rng.choice([-1, 1]) + dx, dy = 0.45 * s * W / 2, 0.30 * s * H / 2 + src = [(0, 0), (W, 0), (W, H), (0, H)] + if side > 0: + dst = [(0, 0), (W - dx, dy), (W - dx, H - dy), (0, H)] + else: + dst = [(dx, dy), (W, 0), (W, H), (dx, H - dy)] + img = img.transform((W, H), Image.PERSPECTIVE, _coeffs(src, dst), Image.BICUBIC, fillcolor=(60, 60, 64)) + return img, f"What is the reading of {inst.tag}, in {inst.scale.unit}?", inst.value, inst.tolerance() + + +def build_hunt(out: Path, per_cell: int = 8, seed: int = 31) -> dict: + out = Path(out) + made = {} + k = 0 + for fam, levels in (("WIRES", {"easy": (6, 3), "hard": (12, 6)}), ("COUNT", {"easy": (15, 40), "hard": (50, 90)}), + ("PERSP", {"easy": 20.0, "hard": 45.0})): + for lvl, p in levels.items(): + n = 0 + while n < per_cell: + k += 1 + s = seed * 100000 + k + if fam == "WIRES": + r = wires(s, *p) + if r is None: + continue + img, q, a = r + _save(out, fam, lvl, s, img, q, a, "tag") + elif fam == "COUNT": + img, q, a, total = shelves(s, *p) + if a < p[0]: + continue + _save(out, fam, lvl, s, img, q, a, "int", meta={"total_boxes": total}) + else: + img, q, a, tol = persp(s, p) + _save(out, fam, lvl, s, img, q, a, "number", tol) + n += 1 + made[f"{fam}_{lvl}"] = n + return made diff --git a/needlepoint/instruments/__init__.py b/needlepoint/instruments/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/needlepoint/instruments/base.py b/needlepoint/instruments/base.py new file mode 100644 index 0000000000000000000000000000000000000000..3d4ab6ad26baef46b4e60ddd5b0816d8615e859a --- /dev/null +++ b/needlepoint/instruments/base.py @@ -0,0 +1,51 @@ +"""Shared helpers for instrument plug-ins.""" +from __future__ import annotations + +import math +from dataclasses import dataclass, field + +import numpy as np +from PIL import ImageDraw + +from ..fonts import font +from ..spec import Instrument + +TAG_H = 30 # tag-plate height in px + + +def snap(v: float, step: float) -> float: + return round(round(v / step) * step, 9) + + +def pt(cx: float, cy: float, ang_deg: float, r: float) -> tuple[float, float]: + a = math.radians(ang_deg) + return (cx + r * math.cos(a), cy - r * math.sin(a)) + + +def draw_tag(d: ImageDraw.ImageDraw, inst: Instrument) -> tuple[int, int, int, int]: + """Tag plate under the instrument (white plate, bold dark text).""" + x0, y0, x1, y1 = inst.box + f = font(17, "bold") + tw = d.textlength(inst.tag, font=f) + w = tw + 18 + cx = (x0 + x1) / 2 + rect = (int(cx - w / 2), y1 - TAG_H, int(cx + w / 2), y1 - 4) + d.rounded_rectangle(rect, radius=4, fill=(245, 245, 240), outline=(30, 30, 30), width=1) + d.text((cx, (rect[1] + rect[3]) / 2), inst.tag, fill=(20, 20, 20), font=f, anchor="mm") + return rect + + +def value_grid(rng: np.random.Generator, scale, step_div: int = 2) -> float: + """Sample a reading on a grid of minor/step_div so it is resolvable by a careful reader.""" + step = scale.minor / step_div + n = int(round((scale.vmax - scale.vmin) / step)) + return snap(scale.vmin + int(rng.integers(0, n + 1)) * step, step) + + +@dataclass +class Decoded: + ok: bool + value: float | None = None + alarm: bool | None = None + reason: str = "ok" + details: dict = field(default_factory=dict) diff --git a/needlepoint/instruments/dial.py b/needlepoint/instruments/dial.py new file mode 100644 index 0000000000000000000000000000000000000000..6c7cfa213eefc00f0917d6fe0432c7c00a4203ed --- /dev/null +++ b/needlepoint/instruments/dial.py @@ -0,0 +1,261 @@ +"""Circular analog dial: sampler, renderer, and image-only decoder. + +Decoder independence: `decode()` receives only panel pixels and the instrument's +layout box. It recovers the dial centre/radius, major-tick angles, scale-label +VALUES (via font-template OCR), needle angle and red-band state from pixels. +""" +from __future__ import annotations + +import math + +import numpy as np +from PIL import Image, ImageDraw +from scipy import ndimage + +from .. import catalog +from ..fonts import font +from ..ocr import parse_number, read_words +from ..spec import Band, Instrument, Scale +from .base import TAG_H, Decoded, draw_tag, pt, snap, value_grid + +KIND = "dial" + + +# ----------------------------------------------------------------------------- sample +def sample_scale(rng, entry, kind=KIND) -> Scale: + q, unit, vmin, vmax, major, minors, dec, prefix, factor = entry + return Scale(vmin=vmin, vmax=vmax, major_step=major, minor_per=int(rng.choice(minors)), + unit=unit, factor=factor, decimals=dec) + + +def densest(sc: Scale, entry) -> Scale: + """Hard tier: the densest minor-tick option the catalogue allows for this instrument.""" + return sc.model_copy(update={"minor_per": int(max(entry[5]))}) + + +def sample_bands(rng, sc: Scale) -> list[Band]: + span = sc.vmax - sc.vmin + bands = [] + hi = snap(sc.vmin + span * rng.uniform(0.65, 0.9), sc.minor) + bands.append(Band(lo=hi, hi=sc.vmax)) + if rng.random() < 0.35: + lo = snap(sc.vmin + span * rng.uniform(0.08, 0.25), sc.minor) + bands.insert(0, Band(lo=sc.vmin, hi=lo)) + return bands + + +def sample(rng, entry, tag: str, difficulty: int) -> Instrument: + sc = sample_scale(rng, entry) + if difficulty >= 5: + sc = densest(sc, entry) + sweep = float(rng.choice([180, 240, 270, 300] if difficulty >= 2 else [240, 270])) + geom = { + "sweep": sweep, + "start": 90 + sweep / 2, + "label_every": (2 if difficulty >= 5 and sc.n_major >= 6 else + int(rng.choice([1, 1, 2])) if difficulty >= 3 and sc.n_major >= 6 else 1), + "needle_w": int(rng.integers(3, 7)), + } + style = { + "face": tuple(catalog.FACES[rng.integers(len(catalog.FACES))]), + "ink": tuple(catalog.INKS[rng.integers(len(catalog.INKS))]), + "needle": tuple(catalog.NEEDLES[rng.integers(len(catalog.NEEDLES))]), + "bezel": tuple(catalog.BEZELS[rng.integers(len(catalog.BEZELS))]), + "label_scale": float(rng.uniform(0.095, 0.12)), + } + return Instrument(kind=KIND, tag=tag, scale=sc, value=value_grid(rng, sc), + bands=sample_bands(rng, sc), geom=geom, style=style) + + +# ----------------------------------------------------------------------------- geometry +def frame(inst: Instrument): + x0, y0, x1, y1 = inst.box + w, h = x1 - x0, y1 - y0 - TAG_H - 6 + R = 0.44 * min(w, h) + return (x0 + x1) / 2, y0 + h / 2 + 2, R + + +def v2a(inst: Instrument, v: float) -> float: + g, sc = inst.geom, inst.scale + return g["start"] - g["sweep"] * (v - sc.vmin) / (sc.vmax - sc.vmin) + + +def label_px(inst: Instrument) -> int: + return int(max(9, min(22, round(frame(inst)[2] * inst.style["label_scale"])))) + + +# ----------------------------------------------------------------------------- render +def render(img: Image.Image, inst: Instrument, overrides: dict | None = None) -> None: + o = overrides or {} + d = ImageDraw.Draw(img) + cx, cy, R = frame(inst) + st, sc, g = inst.style, inst.scale, inst.geom + d.ellipse([cx - 1.07 * R, cy - 1.07 * R, cx + 1.07 * R, cy + 1.07 * R], fill=st["bezel"]) + d.ellipse([cx - R, cy - R, cx + R, cy + R], fill=st["face"]) + for b in inst.bands: + a0, a1 = v2a(inst, b.lo), v2a(inst, b.hi) + n = max(8, int(abs(a1 - a0) * 2)) + for k in range(n + 1): + a = a0 + (a1 - a0) * k / n + d.line([pt(cx, cy, a, 0.885 * R), pt(cx, cy, a, 0.95 * R)], fill=catalog.BAND, width=4) + n_minor = sc.n_major * sc.minor_per + for i in range(n_minor + 1): + a = v2a(inst, sc.vmin + i * sc.minor) + major = i % sc.minor_per == 0 + d.line([pt(cx, cy, a, (0.79 if major else 0.86) * R), pt(cx, cy, a, 0.95 * R)], + fill=st["ink"], width=3 if major else 1) + lp = o.get("label_px", label_px(inst)) + lcol = o.get("label_rgb", st["ink"]) + f = font(lp) + for j, v in enumerate(sc.major_values()): + if j % g["label_every"] and j != sc.n_major: + continue + d.text(pt(cx, cy, v2a(inst, v), 0.66 * R), sc.fmt(v), fill=lcol, font=f, anchor="mm") + d.text((cx, cy + 0.36 * R), o.get("unit_text", sc.unit), fill=st["ink"], font=font(max(12, lp)), anchor="mm") + if not inst.covered: + v = o.get("render_value", inst.value) + a = v2a(inst, v) + d.line([pt(cx, cy, a + 180, 0.12 * R), pt(cx, cy, a, 0.86 * R)], fill=st["needle"], width=g["needle_w"]) + d.ellipse([cx - 0.07 * R, cy - 0.07 * R, cx + 0.07 * R, cy + 0.07 * R], fill=st["needle"] if not inst.covered else st["bezel"]) + if o.get("occlude"): + a = v2a(inst, o.get("render_value", inst.value)) + mx, my = pt(cx, cy, a, 0.38 * R) + rr = 0.26 * R + d.ellipse([mx - rr, my - rr, mx + rr, my + rr], fill=(250, 250, 247)) + draw_tag(d, inst) + + +def evidence_mask(inst: Instrument, size) -> np.ndarray: + """Pixels that carry the reading (needle shaft), drawn alone; used by the visibility gate.""" + m = Image.new("L", size, 0) + d = ImageDraw.Draw(m) + cx, cy, R = frame(inst) + a = v2a(inst, inst.value) + d.line([pt(cx, cy, a, 0.15 * R), pt(cx, cy, a, 0.84 * R)], fill=255, width=max(1, inst.geom["needle_w"] - 2)) + return np.asarray(m) > 0 + + +# ----------------------------------------------------------------------------- decode +def _ray(mask, cx, cy, R, ang, r0, r1, n=60): + t = math.radians(ang) + rs = np.linspace(r0 * R, r1 * R, n) + H, W = mask.shape + px = np.clip(np.round(cx + rs * math.cos(t)).astype(int), 0, W - 1) + py = np.clip(np.round(cy - rs * math.sin(t)).astype(int), 0, H - 1) + return mask[py, px] + + +def _spacing_cv(t): + if len(t) < 3: + return 9.9 + g = sorted(((t[(i + 1) % len(t)] - t[i]) % 360) for i in range(len(t)))[:-1] + return float(np.std(g) / (np.mean(g) + 1e-9)) + + +def decode(panel: np.ndarray, box) -> Decoded: + x0, y0, x1, y1 = box + a = panel[y0:y1, x0:x1].astype(np.int16) + lum = a.mean(axis=2) + bright = lum > 170 + lab, n = ndimage.label(bright) + if n == 0: + return Decoded(False, reason="no_face") + sizes = ndimage.sum(bright, lab, range(1, n + 1)) + face_id = int(np.argmax(sizes)) + 1 + sl = ndimage.find_objects(lab)[face_id - 1] + fy0, fy1, fx0, fx1 = sl[0].start, sl[0].stop, sl[1].start, sl[1].stop + cx, cy = (fx0 + fx1 - 1) / 2, (fy0 + fy1 - 1) / 2 + R = ((fx1 - fx0) + (fy1 - fy0)) / 4 + face_rgb = np.median(a[lab == face_id], axis=0) + dist = np.abs(a - face_rgb).sum(axis=2) + ink = dist > 160 + red = (a[..., 0] > 150) & (a[..., 1] < 90) & (a[..., 2] < 90) + yy, xx = np.mgrid[0:a.shape[0], 0:a.shape[1]] + rr = np.hypot(xx - cx, yy - cy) + + # needle: strongest continuous ink ray in the inner annulus + angs = np.arange(0, 360, 0.25) + prof = np.array([_ray(ink, cx, cy, R, t, 0.16, 0.56).mean() for t in angs]) + prominence = float(prof.max()) + win = np.nonzero(prof >= prof.max() - 0.05)[0] + cand = angs[win] + if cand.max() - cand.min() > 180: + cand = np.where(cand > 180, cand - 360, cand) + needle = float(np.mean(cand)) % 360 + if prominence < 0.85: + return Decoded(False, reason="needle_not_visible", details={"prominence": prominence}) + + # major ticks on a thin ring (minor ticks start further out) + ring = np.array([_ray(ink & ~red, cx, cy, R, t, 0.80, 0.84, n=5).mean() for t in angs]) + hit = ring >= 0.6 + ticks, run = [], [] + for k, h in enumerate(hit): + if h: + run.append(angs[k]) + elif run: + ticks.append(float(np.mean(run))); run = [] + if run: + ticks.append(float(np.mean(run))) + if len(ticks) >= 2 and hit[0] and hit[-1]: + ticks[0] = ((ticks[0] + ticks[-1] + 360) / 2) % 360; ticks.pop() + ticks = sorted(t % 360 for t in ticks) + near = [t for t in ticks if min(abs(t - needle), 360 - abs(t - needle)) <= 3.0] + if near and len(ticks) > 2: + cand_t = [t for t in ticks if t not in near] + if _spacing_cv(cand_t) + 0.02 < _spacing_cv(ticks): + ticks = cand_t + if len(ticks) < 3: + return Decoded(False, reason="too_few_ticks", details={"ticks": ticks}) + gaps = [((ticks[(i + 1) % len(ticks)] - ticks[i]) % 360, i) for i in range(len(ticks))] + _, gi = max(gaps) + start = ticks[gi] + pos = sorted(((start - t) % 360) for t in ticks) # CW position of each major tick + sweep = pos[-1] + + # scale labels by OCR in the label annulus (needle pixels removed) + t = math.radians(needle) + ux, uy = math.cos(t), -math.sin(t) + perp = np.abs((xx - cx) * uy - (yy - cy) * ux) + along = (xx - cx) * ux + (yy - cy) * uy + needle_px = (perp < 5) & (along > 0) + ann = ink & ~red & (rr > 0.52 * R) & (rr < 0.77 * R) & ~needle_px + words = read_words(ann, min_h=6, max_h=int(0.2 * R) + 6) + pairs = [] + for txt, (wy0, wx0, wy1, wx1), s in words: + v = parse_number(txt) + if v is None: + continue + wa = math.degrees(math.atan2(-((wy0 + wy1) / 2 - cy), (wx0 + wx1) / 2 - cx)) % 360 + p = (start - wa) % 360 + k = int(np.argmin([abs(p - q) for q in pos])) + if abs(p - pos[k]) <= 0.45 * (sweep / max(1, len(pos) - 1)): + pairs.append((pos[k], v)) + pairs = sorted(set(pairs)) + if len(pairs) < 2: + return Decoded(False, reason="too_few_labels", details={"words": [w[0] for w in words]}) + # robust linear fit: labels are evenly spaced, so a misread label (e.g. clipped by + # the needle) shows up as an outlier; drop worst outliers while >= 3 labels and >= 60% remain + P = np.array(pairs) + n0 = len(P) + while True: + b, c = np.polyfit(P[:, 0], P[:, 1], 1) + resid = np.abs(P[:, 1] - (b * P[:, 0] + c)) + step = abs(b) * (sweep / max(1, len(pos) - 1)) + if resid.max() <= 0.2 * max(step, 1e-9) or len(P) <= 3 or len(P) - 1 < 0.6 * n0: + break + P = np.delete(P, int(np.argmax(resid)), axis=0) + if resid.max() > 0.2 * max(step, 1e-9) or b <= 0 or len(P) < 2: + return Decoded(False, reason="label_fit_inconsistent", details={"pairs": pairs}) + npos = (start - needle) % 360 + if npos > sweep + 2: + return Decoded(False, reason="needle_outside_scale") + value = float(b * npos + c) + # alarm: is the band ring red where the needle points? + # (sample just beside the needle angle: a minor tick drawn over the band can sit exactly there) + band_hits = max(_ray(red, cx, cy, R, needle + off, 0.89, 0.945, n=8).mean() for off in (-0.8, 0.8)) + return Decoded(True, value=value, alarm=bool(band_hits > 0.5), + details={"needle_deg": round(needle, 2), "prominence": round(prominence, 3), + "n_ticks": len(ticks), "labels": pairs, "fit_resid": float(resid.max()), + # proof geometry in panel coordinates (for overlays; does not affect the value) + "center": [x0 + cx, y0 + cy], "radius": R, "ticks_deg": ticks, + "label_boxes": [[x0 + wx0, y0 + wy0, x0 + wx1, y0 + wy1, t] for t, (wy0, wx0, wy1, wx1), _s in words]}) diff --git a/needlepoint/instruments/digital.py b/needlepoint/instruments/digital.py new file mode 100644 index 0000000000000000000000000000000000000000..f3d80982517f2c527f8d2cfbd9340d497f7bf55f --- /dev/null +++ b/needlepoint/instruments/digital.py @@ -0,0 +1,190 @@ +"""Seven-segment digital readout with a printed high-alarm limit: sampler, renderer, decoder. + +THRESH on a digital readout needs a numeric comparison against a printed limit +(different reasoning from locating a needle in a red band). +""" +from __future__ import annotations + +import numpy as np +from PIL import Image, ImageDraw +from scipy import ndimage + +from .. import catalog +from ..fonts import font +from ..ocr import parse_number, read_words +from ..spec import Band, Instrument, Scale +from .base import TAG_H, Decoded, draw_tag, snap + +KIND = "digital" +SEGS = { # a b c d e f g + "0": "1111110", "1": "0110000", "2": "1101101", "3": "1111001", "4": "0110011", + "5": "1011011", "6": "1011111", "7": "1110000", "8": "1111111", "9": "1111011", + "-": "0000001", " ": "0000000", +} +PAT2CH = {v: k for k, v in SEGS.items()} +LABEL_STRIP = (48, 50, 56) # behind limit/unit text; lighter than the display so the decoder can tell them apart + + +def sample(rng, entry, tag: str, difficulty: int) -> Instrument: + q, unit, vmin, vmax, major, minors, dec, prefix, factor = entry + dec = int(rng.choice([0, 1, 1, 2])) if dec == 0 and vmax <= 100 else max(dec, int(rng.choice([0, 1]))) + sc = Scale(vmin=vmin, vmax=vmax, major_step=major, minor_per=1, unit=unit, factor=factor, decimals=dec) + step = 10 ** (-dec) + value = snap(rng.uniform(vmin, vmax), step) + hi = snap(vmin + (vmax - vmin) * rng.uniform(0.6, 0.9), step) + style = {"seg": tuple(catalog.SEGMENTS[rng.integers(len(catalog.SEGMENTS))]), + "digit_frac": float(rng.uniform(0.55, 0.75))} + return Instrument(kind=KIND, tag=tag, scale=sc, value=value, bands=[Band(lo=hi, hi=vmax)], + geom={"n_digits": len(sc.fmt(vmax).replace(".", "").replace("-", "")) + (1 if vmin < 0 else 0)}, + style=style) + + +def text_of(inst: Instrument, v: float | None = None) -> str: + if inst.covered: + return "-" * inst.geom["n_digits"] + s = inst.scale.fmt(inst.value if v is None else v) + return s.rjust(inst.geom["n_digits"] + (1 if "." in s else 0)) + + +def frame(inst: Instrument): + x0, y0, x1, y1 = inst.box + w, h = x1 - x0, y1 - y0 - TAG_H - 8 + n = inst.geom["n_digits"] + dw = min(0.78 * w / (n + 0.6), 0.32 * h / 1.8) * inst.style["digit_frac"] / 0.65 + dw = min(dw, 0.8 * w / (n + 0.6)) + dh = 1.8 * dw + W = dw * (n + 0.6) + 0.5 * dw + cx = (x0 + x1) / 2 + top = y0 + 0.16 * h + return dict(dw=dw, dh=dh, rx0=cx - W / 2, ry0=top, rx1=cx + W / 2, ry1=top + dh + 0.6 * dw, cx=cx, h=h, y0=y0) + + +def _seg_rects(x, y, dw, dh): + t = 0.17 * dw + hh = dh / 2 + return { + "a": (x + t, y, x + dw - t, y + t), + "b": (x + dw - t, y + t, x + dw, y + hh - t / 2), + "c": (x + dw - t, y + hh + t / 2, x + dw, y + dh - t), + "d": (x + t, y + dh - t, x + dw - t, y + dh), + "e": (x, y + hh + t / 2, x + t, y + dh - t), + "f": (x, y + t, x + t, y + hh - t / 2), + "g": (x + t, y + hh - t / 2, x + dw - t, y + hh + t / 2), + } + + +def render(img: Image.Image, inst: Instrument, overrides: dict | None = None) -> None: + o = overrides or {} + d = ImageDraw.Draw(img) + fr = frame(inst) + seg = inst.style["seg"] + bg = (14, 14, 16) + ghost = tuple(int(0.16 * c + 0.84 * b) for c, b in zip(seg, bg)) + d.rounded_rectangle([fr["rx0"], fr["ry0"], fr["rx1"], fr["ry1"]], radius=6, fill=bg, outline=(150, 150, 150), width=2) + txt = text_of(inst, o.get("render_value")) + dw, dh = fr["dw"], fr["dh"] + x = fr["rx0"] + 0.35 * dw + y = fr["ry0"] + 0.3 * dw + chars = [c for c in txt if c != "."] + dots = set() + k = -1 + for c in txt: + if c == ".": + dots.add(k) + else: + k += 1 + for i, ch in enumerate(chars): + on = SEGS.get(ch, "0000000") + for (name, rect), bit in zip(_seg_rects(x, y, dw * 0.82, dh).items(), on): + d.rectangle(rect, fill=seg if bit == "1" else ghost) + dp = (x + dw * 0.90, y + dh - 0.15 * dw, x + dw * 0.90 + 0.15 * dw, y + dh) + d.rectangle(dp, fill=seg if i in dots else ghost) + x += dw + lim = inst.bands[0].lo + lp = o.get("label_px", 13) + lcol = o.get("label_rgb", (235, 235, 235)) + ly = fr["ry1"] + 0.09 * fr["h"] + # unit sits directly under the digits; the alarm limit is a compact, clearly labelled secondary line + d.text((fr["cx"], fr["ry1"] + 0.04 * fr["h"]), o.get("unit_text", inst.scale.unit), fill=(235, 235, 235), + font=font(max(13, lp + 2), "bold"), anchor="mm") + ly = fr["ry1"] + 0.13 * fr["h"] + d.rounded_rectangle([fr["rx0"] - 6, ly - 0.035 * fr["h"], fr["rx1"] + 6, ly + 0.035 * fr["h"]], + radius=4, fill=LABEL_STRIP) + d.text((fr["rx0"], ly), "ALARM LIMIT", fill=lcol, font=font(max(11, lp - 2), "bold"), anchor="lm") + d.text((fr["rx1"], ly), inst.scale.fmt(lim), fill=lcol, font=font(lp), anchor="rm") + if o.get("occlude"): + d.rectangle([fr["rx0"] + 0.3 * (fr["rx1"] - fr["rx0"]), fr["ry0"] - 4, fr["rx1"] + 4, fr["ry1"] + 4], fill=(240, 240, 236)) + draw_tag(d, inst) + + +def label_px(inst: Instrument) -> int: + return 15 + + +def evidence_mask(inst: Instrument, size) -> np.ndarray: + m = Image.new("L", size, 0) + fr = frame(inst) + ImageDraw.Draw(m).rectangle([fr["rx0"] + 4, fr["ry0"] + 4, fr["rx1"] - 4, fr["ry1"] - 4], fill=255) + return np.asarray(m) > 0 + + +def decode(panel: np.ndarray, box) -> Decoded: + x0, y0, x1, y1 = box + a = panel[y0:y1, x0:x1].astype(np.int16) + mx = a.max(axis=2) + dark = mx < 40 + lab, n = ndimage.label(dark) + if n == 0: + return Decoded(False, reason="no_display") + did = int(np.argmax(ndimage.sum(dark, lab, range(1, n + 1)))) + 1 + sl = ndimage.find_objects(lab)[did - 1] + ry0, ry1, rx0, rx1 = sl[0].start, sl[0].stop, sl[1].start, sl[1].stop + disp = a[ry0:ry1, rx0:rx1] + dmx = disp.max(axis=2) + lit = dmx > 150 + anyseg = dmx > 30 + cols = anyseg.sum(axis=0) > 0.12 * anyseg.shape[0] + lab1, k = ndimage.label(cols) + cells = [np.nonzero(lab1 == i)[0] for i in range(1, k + 1)] + if not cells: + return Decoded(False, reason="no_digits") + wmed = np.median([len(c) for c in cells]) + cells = [c for c in cells if len(c) >= 0.5 * wmed] + chars = [] + for c in cells: + cx0, cx1 = c.min(), c.max() + rows = np.nonzero(anyseg[:, cx0:cx1 + 1].any(axis=1))[0] + cy0, cy1 = rows.min(), rows.max() + dw = cx1 - cx0 + 1 + dh = cy1 - cy0 + 1 + rects = _seg_rects(cx0, cy0, dw, dh) + bits = "" + for name in "abcdefg": + q0, p0, q1, p1 = rects[name] + mxx, myy = int((q0 + q1) / 2), int((p0 + p1) / 2) + win = lit[max(0, myy - 1): myy + 2, max(0, mxx - 1): mxx + 2] + bits += "1" if win.mean() > 0.5 else "0" + ch = PAT2CH.get(bits, "?") + # decimal point: lit pixels just right of the cell, near the bottom + dp = lit[max(0, cy1 - int(0.12 * dw)): cy1 + 1, cx1 + 1: cx1 + int(0.35 * dw) + 1] + chars.append(ch + ("." if dp.size and dp.mean() > 0.3 else "")) + txt = "".join(chars).strip() + if "?" in txt: + return Decoded(False, reason="segment_pattern_unknown", details={"text": txt}) + if txt.replace("-", "") == "": + return Decoded(True, value=None, alarm=None, reason="no_reading", details={"text": txt}) + value = parse_number(txt) + if value is None: + return Decoded(False, reason="unparseable", details={"text": txt}) + # printed limit: rightmost numeric word below the display (light text on panel) + below = a[ry1 + 2:, :] + light = (below.min(axis=2) > 165) & ((below.max(axis=2) - below.min(axis=2)) < 40) + strip = (np.abs(below - np.array(LABEL_STRIP)).sum(axis=2) < 30) + srows = np.nonzero(strip.sum(axis=1) > 0.3 * strip.shape[1])[0] + if len(srows): # the limit lives inside the label strip + light = light[srows.min(): srows.max() + 1] + words = read_words(light, min_h=6, max_h=40) + nums = [(bx[1], parse_number(t)) for t, bx, s in words if parse_number(t) is not None] + limit = max(nums)[1] if nums else None + return Decoded(True, value=value, alarm=None if limit is None else value >= limit, + details={"text": txt, "limit": limit, "display": [x0 + rx0, y0 + ry0, x0 + rx1, y0 + ry1]}) diff --git a/needlepoint/instruments/linear.py b/needlepoint/instruments/linear.py new file mode 100644 index 0000000000000000000000000000000000000000..ea890d872491e87e5ad0a3c5efb5b7851ef122b3 --- /dev/null +++ b/needlepoint/instruments/linear.py @@ -0,0 +1,191 @@ +"""Vertical linear gauge (thermometer / tank level): sampler, renderer, image-only decoder.""" +from __future__ import annotations + +import numpy as np +from PIL import Image, ImageDraw +from scipy import ndimage + +from .. import catalog +from ..fonts import font +from ..ocr import parse_number, read_words +from ..spec import Instrument +from .base import TAG_H, Decoded, draw_tag, value_grid +from .dial import sample_bands, sample_scale + +KIND = "linear" + + +def sample(rng, entry, tag: str, difficulty: int) -> Instrument: + sc = sample_scale(rng, entry, KIND) + geom = { + "label_every": int(rng.choice([1, 1, 2])) if difficulty >= 3 and sc.n_major >= 6 else 1, + "tube_frac": float(rng.uniform(0.11, 0.15)), + "len_frac": float(rng.uniform(0.70, 0.80)), + } + style = { + "plate": tuple(catalog.FACES[rng.integers(len(catalog.FACES))]), + "ink": tuple(catalog.INKS[rng.integers(len(catalog.INKS))]), + "fill": tuple(catalog.FILLS[rng.integers(len(catalog.FILLS))]), + "label_px": int(rng.integers(13, 18)), + } + return Instrument(kind=KIND, tag=tag, scale=sc, value=value_grid(rng, sc), + bands=sample_bands(rng, sc), geom=geom, style=style) + + +def frame(inst: Instrument): + x0, y0, x1, y1 = inst.box + w, h = x1 - x0, y1 - y0 - TAG_H - 8 + cx = (x0 + x1) / 2 + tw = max(20, min(42, inst.geom["tube_frac"] * w)) + L = inst.geom["len_frac"] * h + tx0 = cx + 0.06 * w + ty0 = y0 + 0.13 * h + return dict(cx=cx, tw=tw, L=L, tx0=tx0, tx1=tx0 + tw, ty0=ty0, ty1=ty0 + L, w=w, h=h, y0=y0) + + +def v2row(inst: Instrument, v: float) -> float: + f = frame(inst) + return f["ty1"] - inst.scale.fraction(v) * f["L"] + + +def label_px(inst: Instrument) -> int: + return inst.style["label_px"] + + +def render(img: Image.Image, inst: Instrument, overrides: dict | None = None) -> None: + o = overrides or {} + d = ImageDraw.Draw(img) + f = frame(inst) + st, sc, g = inst.style, inst.scale, inst.geom + d.rounded_rectangle([f["cx"] - 0.36 * f["w"], f["y0"] + 0.02 * f["h"], f["cx"] + 0.36 * f["w"], + f["ty1"] + 0.07 * f["h"]], radius=10, fill=st["plate"]) + d.text((f["tx0"] + f["tw"] / 2, f["ty0"] - 0.06 * f["h"]), o.get("unit_text", sc.unit), fill=st["ink"], + font=font(max(12, label_px(inst))), anchor="mm") + for b in inst.bands: + d.rectangle([f["tx1"] + 4, v2row(inst, b.hi), f["tx1"] + 10, v2row(inst, b.lo)], fill=catalog.BAND) + d.rectangle([f["tx0"], f["ty0"], f["tx1"], f["ty1"]], fill=(255, 255, 255), outline=st["ink"], width=2) + if not inst.covered: + r = v2row(inst, o.get("render_value", inst.value)) + if round(r) <= f["ty1"] - 2: # nothing to fill when the reading sits at the very bottom + d.rectangle([f["tx0"] + 2, round(r), f["tx1"] - 2, f["ty1"] - 2], fill=st["fill"]) + n_minor = sc.n_major * sc.minor_per + for i in range(n_minor + 1): + r = round(v2row(inst, sc.vmin + i * sc.minor)) + major = i % sc.minor_per == 0 + ln = (0.55 if major else 0.28) * f["tw"] + d.line([f["tx0"] - 2 - ln, r, f["tx0"] - 2, r], fill=st["ink"], width=2 if major else 1) + lf = font(o.get("label_px", label_px(inst))) + lcol = o.get("label_rgb", st["ink"]) + for j, v in enumerate(sc.major_values()): + if j % g["label_every"] and j != sc.n_major: + continue + d.text((f["tx0"] - 0.75 * f["tw"] - 6, v2row(inst, v)), sc.fmt(v), fill=lcol, font=lf, anchor="rm") + if o.get("occlude"): + r = v2row(inst, o.get("render_value", inst.value)) + d.rectangle([f["tx0"] - 4, r - 0.12 * f["L"], f["tx1"] + 4, r + 0.12 * f["L"]], fill=(250, 250, 247)) + draw_tag(d, inst) + + +def evidence_mask(inst: Instrument, size) -> np.ndarray: + """The fill boundary region (where the reading is read).""" + m = Image.new("L", size, 0) + d = ImageDraw.Draw(m) + f = frame(inst) + r = v2row(inst, inst.value) + d.rectangle([f["tx0"] + 3, r - 3, f["tx1"] - 3, r + 3], fill=255) + return np.asarray(m) > 0 + + +def decode(panel: np.ndarray, box) -> Decoded: + x0, y0, x1, y1 = box + a = panel[y0:y1, x0:x1].astype(np.int16) + H, W = a.shape[:2] + mx, mn = a.max(axis=2), a.min(axis=2) + lum = a.mean(axis=2) + # plate = largest bright component; its median colour is the background for ink detection + bright = lum > 170 + lab, n = ndimage.label(bright) + if n == 0: + return Decoded(False, reason="no_plate") + pid = int(np.argmax(ndimage.sum(bright, lab, range(1, n + 1)))) + 1 + plate_rgb = np.median(a[lab == pid], axis=0) + psl = ndimage.find_objects(lab)[pid - 1] + inplate = np.zeros(bright.shape, bool) + inplate[psl] = True + ink = (np.abs(a - plate_rgb).sum(axis=2) > 200) & ((mx - mn) < 70) & inplate # dark ink on the plate + white = (mn > 245) + red = (a[..., 0] > 150) & (a[..., 1] < 90) & (a[..., 2] < 90) + # tube walls: the two longest vertical ink lines + col_runs = [] + for x in range(W): + col = ink[:, x] + if col.sum() < 0.3 * H: + continue + lab1, k = ndimage.label(col) + if k: + lens = ndimage.sum(col, lab1, range(1, k + 1)) + j = int(np.argmax(lens)) + if lens[j] >= 0.4 * H: + ys = np.nonzero(lab1 == j + 1)[0] + col_runs.append((x, ys.min(), ys.max())) + if len(col_runs) < 2: + return Decoded(False, reason="no_tube") + xs = [c[0] for c in col_runs] + groups = np.split(np.array(xs), np.nonzero(np.diff(xs) > 2)[0] + 1) + if len(groups) < 2: + return Decoded(False, reason="no_tube") + tx0, tx1 = int(groups[0].max()), int(groups[-1].min()) + ty0 = min(c[1] for c in col_runs); ty1 = max(c[2] for c in col_runs) + tw = tx1 - tx0 + xc = (tx0 + tx1) // 2 + # fill top: highest row of the contiguous fill run starting at the tube bottom + col = a[:, xc] + is_fill = ((col.max(axis=1) - col.min(axis=1)) > 70) + r = ty1 - 3 + if not is_fill[r]: + top = float(ty1) # empty tube + else: + while r > ty0 and is_fill[r - 1]: + r -= 1 + top = float(r) + # tick rows (majors only reach this far left) + xm = int(tx0 - 2 - 0.42 * tw) + if xm < 0: + return Decoded(False, reason="no_ticks") + lab2, k = ndimage.label(ink[:, xm]) + ticks = [float(np.mean(np.nonzero(lab2 == i)[0])) for i in range(1, k + 1)] + ticks = [t for t in ticks if ty0 - 3 <= t <= ty1 + 3] + if len(ticks) < 3: + return Decoded(False, reason="too_few_ticks") + spacing = float(np.median(np.diff(sorted(ticks)))) + words = read_words(ink[:, : max(1, int(tx0 - 0.6 * tw))], min_h=6, max_h=40) + pairs = [] + for txt, (wy0, wx0, wy1, wx1), s in words: + v = parse_number(txt) + if v is None: + continue + row = (wy0 + wy1) / 2 + k2 = int(np.argmin([abs(row - t) for t in ticks])) + if abs(row - ticks[k2]) <= 0.4 * spacing: + pairs.append((ticks[k2], v)) + pairs = sorted(set(pairs)) + if len(pairs) < 2: + return Decoded(False, reason="too_few_labels") + P = np.array(pairs) + n0 = len(P) + while True: + b, c = np.polyfit(P[:, 0], P[:, 1], 1) + resid = np.abs(P[:, 1] - (b * P[:, 0] + c)) + step = abs(b) * spacing + if resid.max() <= 0.2 * step or len(P) <= 3 or len(P) - 1 < 0.6 * n0: + break + P = np.delete(P, int(np.argmax(resid)), axis=0) + if resid.max() > 0.2 * step or b >= 0: + return Decoded(False, reason="label_fit_inconsistent") + value = float(b * top + c) + strip = red[max(0, int(top) - 1): int(top) + 2, tx1 + 4: tx1 + 11] + return Decoded(True, value=value, alarm=bool(strip.size and strip.mean() > 0.5), + details={"fill_top_row": top, "n_ticks": len(ticks), "labels": pairs, + "tube": [x0 + tx0, y0 + ty0, x0 + tx1, y0 + ty1], "fill_top_y": y0 + top, + "tick_rows": [y0 + t for t in ticks], + "label_boxes": [[x0 + wx0, y0 + wy0, x0 + wx1, y0 + wy1, t] for t, (wy0, wx0, wy1, wx1), _s in words]}) diff --git a/needlepoint/ledger.py b/needlepoint/ledger.py new file mode 100644 index 0000000000000000000000000000000000000000..e3b6330d9a8d0a4c59bc0b6ac0ec5fee5c2d9071 --- /dev/null +++ b/needlepoint/ledger.py @@ -0,0 +1,119 @@ +"""Variation ledger: measures *meaningful* (structural) variation of a run, separately from +surface variation (colours/fonts), plus answer balance and near-duplicates.""" +from __future__ import annotations + +import json +import math +from collections import Counter, defaultdict +from itertools import combinations +from pathlib import Path + +import numpy as np +from PIL import Image +from scipy.stats import chisquare + +from .factory import balance_key +from .spec import Panel +from .ops import Question + +STRUCT_KEYS_EXCLUDE = {"profile"} + + +def _entropy(counter: Counter) -> tuple[float, float, float]: + n = sum(counter.values()) + if n == 0 or len(counter) < 2: + return 0.0, 0.0, float(len(counter)) + h = -sum(c / n * math.log(c / n) for c in counter.values()) + return h, h / math.log(len(counter)), math.exp(h) + + +def _hamming(a: str, b: str) -> int: + return bin(int(a, 16) ^ int(b, 16)).count("1") + + +def dhash256(path: Path) -> str: + """16x16 difference hash (256 bits): fine enough to separate panels that differ in readings.""" + g = np.asarray(Image.open(path).convert("L").resize((17, 16)), dtype=np.int16) + bits = (g[:, 1:] > g[:, :-1]).flatten() + return f"{int(''.join('1' if b else '0' for b in bits), 2):064x}" + + +def build_ledger(run_dir: Path, write: bool = True) -> dict: + run_dir = Path(run_dir) + certs = [json.loads((d / "certificate.json").read_text()) for d in sorted((run_dir / "tasks").iterdir()) if d.is_dir()] + answers = {c["task_id"]: json.loads((run_dir / "tasks" / c["task_id"] / "answer.json").read_text()) for c in certs} + n = len(certs) + sigs = Counter() + coverage = Counter() + steps = Counter() + ops = Counter() + fams = Counter() + surface = defaultdict(Counter) + dh = [] + groups = defaultdict(Counter) + for c in certs: + vs = {k: v for k, v in c["variation_signature"].items() if k not in STRUCT_KEYS_EXCLUDE} + fam = c.get("family", "instruments") + fams[fam] += 1 + ops[vs["op"]] += 1 + sigs[json.dumps(vs, sort_keys=True)] += 1 + coverage[(fam, vs["op"], vs.get("difficulty"))] += 1 + steps[c.get("steps", len(c.get("trace", [])))] += 1 + dh.append((c["task_id"], dhash256(run_dir / "tasks" / c["task_id"] / "image.png"))) + if "surface" in c: + surface["background"][str(c["surface"]["background"])] += 1 + for st in c["surface"]["styles"]: + for k in ("face", "plate", "ink", "needle", "fill", "seg", "bezel"): + if k in st: + surface[k][str(st[k])] += 1 + if fam == "instruments" and "spec" in c: + panel = Panel(**c["spec"]) + a = answers[c["task_id"]] + q = Question(c["op"], "", a["answer"], a["answer_type"], targets=[i for i, x in enumerate(panel.instruments) if x.tag in c["targets"]]) + key = balance_key(panel, q) + if key: + groups[key[0]][str(key[1])] += 0 # ensure group exists + for u in key[2]: + groups[key[0]].setdefault(str(u), 0) + groups[key[0]][str(key[1])] += 1 + elif fam == "wiring": + groups[f"TRACE/n{c['variation_signature']['n_wires']}"][answers[c["task_id"]]["answer"]] += 1 + h, hn, eff = _entropy(sigs) + twin_pairs = {frozenset((c["task_id"], c["twin"]["twin_id"])) for c in certs if c.get("twin", {}).get("twin_id")} + by_id = {c["task_id"]: c for c in certs} + qa = {c["task_id"]: (json.loads((run_dir / "tasks" / c["task_id"] / "task.json").read_text())["question"], + json.dumps(answers[c["task_id"]]["answer"])) for c in certs} + same_spec = sum(v - 1 for v in Counter((c["spec_hash"], qa[c["task_id"]][0]) for c in certs).values() if v > 1) + similar = true_dup = 0 + if len(dh) <= 3000: + for (ta, a), (tb, b) in combinations(dh, 2): + if _hamming(a, b) <= 8 and frozenset((ta, tb)) not in twin_pairs: + similar += 1 + true_dup += qa[ta] == qa[tb] + exact_dup, near = true_dup + same_spec, similar + balance = {} + for g, cnt in groups.items(): + obs = [v for v in cnt.values()] + if sum(obs) >= 8 and len(obs) >= 2: + p = float(chisquare(obs).pvalue) + else: + p = None + balance[g] = {"counts": dict(cnt), "chi2_p_uniform": None if p is None else round(p, 4)} + feas_ops = sorted({k[1] for k in coverage}) + feas_diff = sorted({k[2] for k in coverage if k[2] is not None}) + led = { + "n_tasks": n, "families": dict(fams), "ops": dict(ops), + "structural": {"unique_signatures": len(sigs), "entropy_nats": round(h, 3), "normalized_entropy": round(hn, 3), + "effective_number_of_signatures": round(eff, 1), "share_unique": round(len(sigs) / max(1, n), 3)}, + "coverage": {"cells_filled": len(coverage), "cells": {f"{f}|{o}|d{d}": v for (f, o, d), v in sorted(coverage.items(), key=str)}, + "ops": feas_ops, "difficulties": feas_diff}, + "reasoning_steps": {str(k): v for k, v in sorted(steps.items())}, + "duplicates": {"true_duplicates": exact_dup, + "definition": "same spec and same question, or visually near-identical (dHash-256 Hamming <= 8) with the same question and answer", + "similar_looking_pairs_with_different_answers": near, "designed_twin_pairs": len(twin_pairs)}, + "surface_variation_not_counted": {k: len(v) for k, v in surface.items()}, + "answer_balance": balance, + } + if write: + (run_dir / "ledger.json").write_text(json.dumps(led, indent=2, default=str)) + return led diff --git a/needlepoint/ocr.py b/needlepoint/ocr.py new file mode 100644 index 0000000000000000000000000000000000000000..9f7424a7688739b9d1367092d0e772566b3b79f2 --- /dev/null +++ b/needlepoint/ocr.py @@ -0,0 +1,115 @@ +"""Tiny template OCR for printed scale labels. + +Templates are rendered from the *bundled font* (known to anyone holding the +package), never from task values. This is what lets the image-only decoder read +scale labels without access to the spec. +""" +from __future__ import annotations + +from functools import lru_cache + +import numpy as np +from PIL import Image, ImageDraw +from scipy import ndimage + +from .fonts import font + +CHARS = "0123456789" +NORM = (18, 26) # w, h + + +def _norm(mask: np.ndarray) -> np.ndarray: + ys, xs = np.nonzero(mask) + if len(xs) == 0: + return np.zeros(NORM[::-1], dtype=np.float32) + crop = mask[ys.min(): ys.max() + 1, xs.min(): xs.max() + 1].astype(np.uint8) * 255 + im = Image.fromarray(crop).resize(NORM, Image.BILINEAR) + return np.asarray(im, dtype=np.float32) / 255.0 + + +@lru_cache(maxsize=4) +def templates(face: str = "sans") -> dict[str, np.ndarray]: + out = {} + for ch in CHARS: + im = Image.new("L", (120, 120), 0) + ImageDraw.Draw(im).text((20, 10), ch, fill=255, font=font(72, face)) + out[ch] = _norm(np.asarray(im) > 127) + return out + + +def classify(mask: np.ndarray) -> tuple[str, float]: + """Classify one connected component. Returns (char, score in [0,1]).""" + h, w = mask.shape + fill = mask.mean() if mask.size else 0 + if h <= 0 or w <= 0: + return "?", 0.0 + # punctuation by shape + if w >= 1.6 * h and fill > 0.6: + return "-", 0.9 + v = _norm(mask) + best, score = "?", -1.0 + for ch, t in templates().items(): + a, b = v - v.mean(), t - t.mean() + s = float((a * b).sum() / (np.sqrt((a * a).sum() * (b * b).sum()) + 1e-9)) + if s > score: + best, score = ch, s + return best, score + + +def read_words(mask: np.ndarray, min_h: int = 5, max_h: int = 80, min_score: float = 0.55): + """Find text words in a binary ink mask. Returns list of (text, (y0,x0,y1,x1), mean_score).""" + lab, n = ndimage.label(mask, structure=np.ones((3, 3))) + if n == 0: + return [] + comps = [] + for i, sl in enumerate(ndimage.find_objects(lab), start=1): + if sl is None: + continue + sub = lab[sl] == i + y0, y1, x0, x1 = sl[0].start, sl[0].stop, sl[1].start, sl[1].stop + comps.append(dict(y0=y0, y1=y1, x0=x0, x1=x1, h=y1 - y0, w=x1 - x0, m=sub, area=int(sub.sum()))) + digits_h = [c["h"] for c in comps if min_h <= c["h"] <= max_h and c["w"] <= c["h"] * 1.2] + if not digits_h: + return [] + H = float(np.median(digits_h)) + chars = [] + for c in comps: + if min_h <= c["h"] <= max_h and abs(c["h"] - H) <= 0.35 * H and c["w"] <= 1.2 * c["h"]: + ch, s = classify(c["m"]) + if s >= min_score: + chars.append({**c, "ch": ch, "s": s}) + elif c["h"] <= 0.3 * H and c["w"] <= 0.3 * H and c["area"] >= 2: + chars.append({**c, "ch": ".", "s": 0.8}) # decimal point (low, small) + elif c["h"] <= 0.25 * H and 0.25 * H <= c["w"] <= 1.2 * H and c["w"] >= 2 * c["h"]: + chars.append({**c, "ch": "-", "s": 0.8}) # minus sign (flat) + # group into words: same text line, small horizontal gaps + chars.sort(key=lambda c: (c["x0"])) + words: list[list[dict]] = [] + for c in chars: + cy = (c["y0"] + c["y1"]) / 2 + placed = False + for w in words: + last = w[-1] + ly0 = min(x["y0"] for x in w if x["ch"] not in ".-") if any(x["ch"] not in ".-" for x in w) else last["y0"] + ly1 = max(x["y1"] for x in w if x["ch"] not in ".-") if any(x["ch"] not in ".-" for x in w) else last["y1"] + if ly0 - 0.3 * H <= cy <= ly1 + 0.3 * H and 0 <= c["x0"] - last["x1"] <= 0.55 * H: + w.append(c); placed = True; break + if not placed: + words.append([c]) + out = [] + for w in words: + # a word must contain a digit; '.' must sit near the baseline + if not any(c["ch"].isdigit() for c in w): + continue + base = max(c["y1"] for c in w if c["ch"].isdigit()) + txt = "".join(c["ch"] for c in w if c["ch"] != "." or c["y1"] >= base - 0.35 * H) + bbox = (min(c["y0"] for c in w), min(c["x0"] for c in w), max(c["y1"] for c in w), max(c["x1"] for c in w)) + out.append((txt, bbox, float(np.mean([c["s"] for c in w])))) + return out + + +def parse_number(txt: str): + try: + return float(txt) + except ValueError: + return None diff --git a/needlepoint/ops.py b/needlepoint/ops.py new file mode 100644 index 0000000000000000000000000000000000000000..f238945cc9ecb71fb1c6b001249d4beb84a54377 --- /dev/null +++ b/needlepoint/ops.py @@ -0,0 +1,112 @@ +"""Executable question programs. Each op computes its answer from the spec and +records a reasoning trace. Ops are the main axis of *meaningful* variation: +they differ in what must be perceived and how it must be combined.""" +from __future__ import annotations + +from dataclasses import asdict, dataclass, field +from typing import Optional + +from .spec import Instrument, Panel + +ABSTAIN_ANSWER = "cannot determine" +OPS = ["READ", "THRESH", "COMPARE", "DIFF", "COUNT_ALARM", "SCALE", "BIND", "ABSTAIN"] + + +@dataclass +class Question: + op: str + text: str + answer: object + answer_type: str # number | yesno | tag | int | abstain + tolerance: float = 0.0 + unit: str = "" + targets: list = field(default_factory=list) # instrument indices + trace: list = field(default_factory=list) + steps: int = 1 + + def to_dict(self): + return asdict(self) + + +def _fmt(v: float) -> str: + return f"{v:g}" + + +def _readable(inst: Instrument) -> bool: + return not inst.covered + + +def read(panel: Panel, i: int, op: str = "READ") -> Optional[Question]: + inst = panel.instruments[i] + if inst.scale.factor != 1 or inst.covered: + return None + return Question(op, f"What is the reading of {inst.tag}, in {inst.scale.unit}?", inst.value, "number", + inst.tolerance(), inst.scale.unit, [i], [f"READ {inst.tag} -> {_fmt(inst.value)} {inst.scale.unit}"]) + + +def scale(panel: Panel, i: int) -> Optional[Question]: + inst = panel.instruments[i] + if inst.scale.factor == 1 or inst.covered: + return None + base = inst.scale.unit.split(" ")[0] + ans = inst.actual() + return Question("SCALE", f"What is the actual value shown by {inst.tag}, in {base}? " + f"Apply any multiplier printed on the instrument.", ans, "number", + inst.tolerance() * inst.scale.factor, base, [i], + [f"READ {inst.tag} -> {_fmt(inst.value)}", f"x{_fmt(inst.scale.factor)} -> {_fmt(ans)} {base}"], 2) + + +def thresh(panel: Panel, i: int) -> Optional[Question]: + inst = panel.instruments[i] + if inst.covered: + return None + ans = "yes" if inst.in_alarm() else "no" + return Question("THRESH", f"Is {inst.tag} currently in its alarm range? (The alarm range is the red zone " + f"on analog instruments, or at/above the printed ALARM LIMIT on digital displays.) Answer yes or no.", + ans, "yesno", 0.0, "", [i], + [f"READ {inst.tag} -> {_fmt(inst.value)}", f"in alarm band -> {ans}"], 2) + + +def _same_unit_groups(panel: Panel) -> list[list[int]]: + groups: dict = {} + for i, inst in enumerate(panel.instruments): + if _readable(inst) and inst.scale.factor == 1: + groups.setdefault(inst.scale.unit, []).append(i) + return [g for g in groups.values() if len(g) >= 2] + + +def compare(panel: Panel, group: list[int]) -> Optional[Question]: + insts = [panel.instruments[i] for i in group] + order = sorted(range(len(group)), key=lambda k: insts[k].value, reverse=True) + top, second = insts[order[0]], insts[order[1]] + tags = ", ".join(x.tag for x in insts) + return Question("COMPARE", f"Which of these instruments shows the highest reading: {tags}? Answer with the tag.", + top.tag, "tag", 0.0, "", list(group), + [f"READ {x.tag} -> {_fmt(x.value)}" for x in insts] + [f"max -> {top.tag}"], len(group) + 1) + + +def diff(panel: Panel, i: int, j: int) -> Optional[Question]: + a, b = panel.instruments[i], panel.instruments[j] + ans = round(a.value - b.value, 9) + return Question("DIFF", f"What is the reading of {a.tag} minus the reading of {b.tag}, in {a.scale.unit}?", + ans, "number", a.tolerance() + b.tolerance(), a.scale.unit, [i, j], + [f"READ {a.tag} -> {_fmt(a.value)}", f"READ {b.tag} -> {_fmt(b.value)}", f"subtract -> {_fmt(ans)}"], 3) + + +def count_alarm(panel: Panel) -> Optional[Question]: + if len(panel.instruments) < 2 or any(x.covered for x in panel.instruments): + return None + n = sum(x.in_alarm() for x in panel.instruments) + return Question("COUNT_ALARM", "How many instruments on this panel are currently in their alarm range? " + "(Red zone on analog instruments; at/above the printed ALARM LIMIT on digital displays.)", + n, "int", 0.0, "", list(range(len(panel.instruments))), + [f"{x.tag} alarm={x.in_alarm()}" for x in panel.instruments] + [f"count -> {n}"], + len(panel.instruments) + 1) + + +def abstain(panel: Panel, i: int) -> Optional[Question]: + inst = panel.instruments[i] + if not inst.covered: + return None + return Question("ABSTAIN", f"What is the reading of {inst.tag}, in {inst.scale.unit}?", ABSTAIN_ANSWER, "abstain", + 0.0, inst.scale.unit, [i], [f"{inst.tag} indicator absent -> {ABSTAIN_ANSWER}"], 1) diff --git a/needlepoint/panel.py b/needlepoint/panel.py new file mode 100644 index 0000000000000000000000000000000000000000..b9e803d21f7ef29f5d0a82d091bfde3c8389ad61 --- /dev/null +++ b/needlepoint/panel.py @@ -0,0 +1,106 @@ +"""Panel sampling (ground truth first), layout and rendering.""" +from __future__ import annotations + +import io + +import numpy as np +from PIL import Image, ImageFilter + +from . import catalog +from .instruments import dial, digital, linear +from .spec import Instrument, Panel + +KINDS = {"dial": dial, "linear": linear, "digital": digital} +W, H = 1024, 768 +GRID = {1: (1, 1), 2: (2, 1), 3: (3, 1), 4: (2, 2), 5: (3, 2), 6: (3, 2)} +DIGITAL_ONLY = {"infusion"} +VERSION = "0.1.0" + + +def _boxes(n: int) -> list[tuple[int, int, int, int]]: + cols, rows = GRID[n] + pad = 14 + cw, rh = (W - pad) / cols, (H - pad) / rows + out = [] + for i in range(n): + r, c = divmod(i, cols) + out.append((int(pad + c * cw), int(pad + r * rh), int((c + 1) * cw), int((r + 1) * rh))) + return out + + +def _tag(prefix: str, rng, used: set) -> str: + while True: + t = f"{prefix} {'ABCDEFGH'[rng.integers(8)]}" if " " in prefix else f"{prefix}-{int(rng.integers(101, 999))}" + if t not in used: + used.add(t) + return t + + +def sample_panel(seed: int, profile: str = "industrial", n_instruments: int = 1, kinds=None, + same_scale: bool = False, difficulty: int = 2) -> Panel: + """Sample a panel spec. `same_scale` makes all instruments share kind, unit and scale + (label-binding distractors).""" + rng = np.random.default_rng(seed) + cat = catalog.PROFILES[profile] + kinds = kinds or ["dial", "dial", "linear", "digital"] + used: set = set() + insts: list[Instrument] = [] + shared = None + for box in _boxes(n_instruments): + if same_scale and shared is not None: + entry, kind = shared + else: + kind = str(rng.choice(kinds)) + if kind == "digital": # digital readouts: any plain-unit entry (no printed multiplier) + pool = [e for e in cat if e[8] == 1] + else: # analog: everything except digital-only devices + pool = [e for e in cat if e[0] not in DIGITAL_ONLY] + entry = pool[rng.integers(len(pool))] + shared = (entry, kind) + mod = KINDS[kind] + inst = mod.sample(rng, entry, _tag(entry[7], rng, used), difficulty) + if same_scale and insts: + inst = inst.model_copy(update={"scale": insts[0].scale, "bands": insts[0].bands, "geom": insts[0].geom, + "value": inst.value if kind == "digital" else inst.value}) + inst.value = min(max(inst.value, inst.scale.vmin), inst.scale.vmax) + inst.box = box + insts.append(inst) + bg = catalog.PANEL_BG[rng.integers(len(catalog.PANEL_BG))] + degrade = {} + if difficulty >= 4: # camera-style capture: still decodable from the final pixels or rejected + degrade = {"blur": round(float(rng.uniform(0.4, 1.0)), 2), "noise": round(float(rng.uniform(3, 7)), 1), + "jpeg": int(rng.integers(55, 80)), "light": round(float(rng.uniform(0.0, 0.25)), 2), + "light_dir": round(float(rng.uniform(0, 360)), 1), "noise_seed": int(rng.integers(1 << 30))} + return Panel(panel_id=f"np-{seed:09d}", seed=seed, profile=profile, width=W, height=H, + background=tuple(bg), instruments=insts, degrade=degrade, generator_version=VERSION) + + +def apply_degrade(img: Image.Image, dg: dict) -> Image.Image: + if not dg: + return img + img = img.filter(ImageFilter.GaussianBlur(dg["blur"])) + a = np.asarray(img).astype(np.float32) + h, w = a.shape[:2] + t = np.radians(dg["light_dir"]) + yy, xx = np.mgrid[0:h, 0:w] + grad = ((xx / w - 0.5) * np.cos(t) + (yy / h - 0.5) * np.sin(t)) + a *= (1.0 + dg["light"] * grad)[..., None] + a += np.random.default_rng(dg["noise_seed"]).normal(0, dg["noise"], a.shape) + img = Image.fromarray(np.clip(a, 0, 255).astype(np.uint8)) + buf = io.BytesIO() + img.save(buf, "JPEG", quality=dg["jpeg"]) + return Image.open(io.BytesIO(buf.getvalue())).convert("RGB") + + +def render(panel: Panel, overrides: dict[int, dict] | None = None, only: int | None = None) -> Image.Image: + img = Image.new("RGB", (panel.width, panel.height), panel.background) + for i, inst in enumerate(panel.instruments): + if only is not None and i != only: + continue + KINDS[inst.kind].render(img, inst, (overrides or {}).get(i)) + return apply_degrade(img, panel.degrade) + + +def decode(img: Image.Image | np.ndarray, inst: Instrument): + arr = np.asarray(img) if isinstance(img, Image.Image) else img + return KINDS[inst.kind].decode(arr, inst.box) diff --git a/needlepoint/pilot.py b/needlepoint/pilot.py new file mode 100644 index 0000000000000000000000000000000000000000..1acda78e7196407538d88c4a392d49a0293c5664 --- /dev/null +++ b/needlepoint/pilot.py @@ -0,0 +1,83 @@ +"""EXP-02 pilot set (red-team specification, strategy/05 + 06): + - 30 READ/BIND items + - THRESH answer-flip pairs (original + twin), each original also asked as a READ of the same gauge + (measures reading/decision disagreement) + - 30 multi-instrument items: COMPARE + COUNT_ALARM +""" +from __future__ import annotations + +import json +from pathlib import Path + +import numpy as np + +from . import gates, ops +from . import panel as P +from .factory import _task_id, build, twin_of, write_task + + +def _accept(panel, q): + img = P.render(panel) + rep = gates.run_all(panel, img, q) + return (img, rep) if rep["passed"] else (None, rep) + + +def build_pilot(out: Path, seed: int = 2026, n_read: int = 30, n_thresh_pairs: int = 15, + n_compare: int = 15, n_count: int = 15, diffs: tuple = (1, 2, 3)) -> dict: + out = Path(out) + rng = np.random.default_rng(seed) + groups: dict[str, list[str]] = {"READ": [], "THRESH_PAIR": [], "READ_OF_THRESH": [], "COMPARE": [], "COUNT_ALARM": []} + links = [] + k = 0 + + def next_seed(): + nonlocal k + k += 1 + return seed * 1_000_000 + k + + while len(groups["READ"]) < n_read: + s = next_seed() + op = "BIND" if rng.random() < 0.3 else "READ" + b = build(s, op, "industrial", int(rng.choice(diffs))) + if b: + img, rep = _accept(*b) + if img is not None: + tid = _task_id(s, op) + write_task(out, tid, b[0], img, b[1], rep, 2) + groups["READ"].append(tid) + while len(groups["THRESH_PAIR"]) < 2 * n_thresh_pairs: + s = next_seed() + b = build(s, "THRESH", "industrial", int(rng.choice(diffs))) + if not b: + continue + panel, q = b + img, rep = _accept(panel, q) + tw = twin_of(panel, q, s) if img is not None else None + rq = ops.read(panel, q.targets[0]) if tw else None + if not (tw and rq): + continue + img2, rep2 = _accept(*tw) + img3, rep3 = _accept(panel, rq) + if img2 is None or img3 is None: + continue + t1, t2, t3 = _task_id(s, "THRESH"), _task_id(s, "THRESH", "twin"), _task_id(s, "READ", "of-thresh") + write_task(out, t1, panel, img, q, rep, 2, twin_id=t2) + write_task(out, t2, tw[0], img2, tw[1], rep2, 2, twin_of_id=t1) + write_task(out, t3, panel, img3, rq, rep3, 2) + groups["THRESH_PAIR"] += [t1, t2] + groups["READ_OF_THRESH"].append(t3) + links.append({"thresh": t1, "twin": t2, "read_same_gauge": t3}) + for op, n in (("COMPARE", n_compare), ("COUNT_ALARM", n_count)): + while len(groups[op]) < n: + s = next_seed() + b = build(s, op, "industrial", int(rng.choice([max(2, d) for d in diffs]))) + if b: + img, rep = _accept(*b) + if img is not None: + tid = _task_id(s, op) + write_task(out, tid, b[0], img, b[1], rep, 3) + groups[op].append(tid) + manifest = {"seed": seed, "groups": groups, "thresh_links": links, + "n_tasks": sum(len(v) for v in groups.values()), "candidates_seen": k} + (out / "pilot_manifest.json").write_text(json.dumps(manifest, indent=2)) + return manifest diff --git a/needlepoint/report.py b/needlepoint/report.py new file mode 100644 index 0000000000000000000000000000000000000000..caa811347f5b6efc0c2a8abc42dda20edda1efe1 --- /dev/null +++ b/needlepoint/report.py @@ -0,0 +1,339 @@ +"""Evidence report for one or more run directories: Markdown + self-contained HTML. + +Every number in the report is computed from files in the run directories (certificates, +eval caches, faults_report.json, ledger.json, human_check/score.json, ablation_report.json). +Charts are static PNGs; each has a data table next to it (colour is never the only carrier). +""" +from __future__ import annotations + +import base64 +import html as H +import io +import json +from collections import Counter, defaultdict +from pathlib import Path + +import matplotlib + +matplotlib.use("Agg") +import matplotlib.pyplot as plt # noqa: E402 + +from .analysis import attribute, load_results, wilson # noqa: E402 +from .evaluate import score # noqa: E402 +from .ledger import build_ledger # noqa: E402 + +# Categorical slots in fixed order (validated: CVD dE >= 9.1, normal-vision floor 19.6). Colour follows the model. +MODEL_ORDER = ["gpt-6.2-astra", "claude-opus-5-5", "gpt-6-luna", "claude-haiku-5-5", "gemini-3.1-flash-lite", + "gemini-3.1-pro-preview", "gemini-3.8-flash"] +SLOTS = ["#2a78d6", "#eb6834", "#1baf7a", "#eda100", "#e87ba4", "#008300", "#6250d6"] +COLOR = dict(zip(MODEL_ORDER, SLOTS)) +INK, INK2, GRID, SURF = "#0b0b0b", "#52514e", "#e6e5e1", "#fcfcfb" + + +def _style(ax): + ax.set_facecolor(SURF) + for s in ("top", "right"): + ax.spines[s].set_visible(False) + for s in ("left", "bottom"): + ax.spines[s].set_color(GRID) + ax.tick_params(colors=INK2, labelsize=9) + ax.yaxis.grid(True, color=GRID, linewidth=0.8) + ax.set_axisbelow(True) + + +def _png(fig) -> bytes: + buf = io.BytesIO() + fig.savefig(buf, format="png", dpi=150, bbox_inches="tight", facecolor=SURF) + plt.close(fig) + return buf.getvalue() + + +def _models(res) -> list[str]: + present = {m for m, _ in res} + return [m for m in MODEL_ORDER if m in present] + sorted(present - set(MODEL_ORDER)) + + +def collect(run_dirs: list[Path]) -> dict: + tasks, res, blind = {}, {}, {} + for rd in run_dirs: + rd = Path(rd) + for d in sorted((rd / "tasks").iterdir()): + if d.is_dir(): + tasks[d.name] = {"dir": d, "cert": json.loads((d / "certificate.json").read_text()), + "ans": json.loads((d / "answer.json").read_text())} + res.update(load_results(rd, "image")) + blind.update(load_results(rd, "blind")) + return {"tasks": tasks, "res": res, "blind": blind} + + +def model_tables(C) -> dict: + tasks, res = C["tasks"], C["res"] + models = _models(res) + by_op, by_lvl, attrib, cost, n_ans = (defaultdict(lambda: defaultdict(list)), defaultdict(lambda: defaultdict(list)), + defaultdict(Counter), Counter(), Counter()) + twin_ok = defaultdict(lambda: [0, 0]) + for (m, t), r in res.items(): + if t not in tasks: + continue + T = tasks[t] + c = score(T["ans"], r["answer"]) + fam = T["cert"].get("family", "instruments") + op = T["cert"]["op"] + by_op[f"{fam}:{op}"][m].append(c) + lvl = T["cert"].get("variation_signature", {}).get("difficulty") + if lvl is not None: + by_lvl[f"{fam}:d{lvl}"][m].append(c) + cost[m] += r.get("cost_usd", 0) + n_ans[m] += 1 + if c < 1 and "spec" in T["cert"] and fam == "instruments": + attrib[m][f"{op}:{attribute(T['cert'], T['ans'], r['answer'])}"] += 1 + tw = T["cert"].get("twin", {}).get("twin_id") + if tw and (m, tw) in res: + c2 = score(tasks[tw]["ans"], res[(m, tw)]["answer"]) if tw in tasks else 0 + twin_ok[m][0] += int(c == 1 and c2 == 1) + twin_ok[m][1] += 1 + blind = defaultdict(list) + for (m, t), r in C["blind"].items(): + if t in tasks: + blind[m].append(score(tasks[t]["ans"], r["answer"])) + return {"models": models, "by_op": by_op, "by_lvl": by_lvl, "attrib": attrib, "cost": cost, "n": n_ans, + "twin": {m: wilson(*v) for m, v in twin_ok.items()}, + "blind": {m: wilson(int(sum(v)), len(v)) for m, v in blind.items()}} + + +def chart_by_op(MT) -> bytes: + ops = sorted(MT["by_op"]) + models = MT["models"] + fig, ax = plt.subplots(figsize=(max(7, 1.1 * len(ops)), 3.6)) + _style(ax) + w = 0.8 / max(1, len(models)) + for k, m in enumerate(models): + xs, ys, lo, hi = [], [], [], [] + for i, op in enumerate(ops): + v = MT["by_op"][op].get(m) + if not v: + continue + p, a, b = wilson(int(sum(v)), len(v)) + xs.append(i + (k - (len(models) - 1) / 2) * w) + ys.append(p); lo.append(p - a); hi.append(b - p) + ax.bar(xs, ys, width=w * 0.88, color=COLOR.get(m, "#888"), label=m, edgecolor=SURF, linewidth=1) + ax.errorbar(xs, ys, yerr=[lo, hi], fmt="none", ecolor=INK2, elinewidth=0.9, capsize=2) + ax.set_xticks(range(len(ops)), [o.replace("instruments:", "").replace("wiring:", "wiring ") for o in ops], rotation=20, ha="right") + ax.set_ylim(0, 1.05) + ax.set_ylabel("accuracy (95% CI)", color=INK2, fontsize=9) + ax.legend(frameon=False, fontsize=8, ncol=min(5, len(models)), loc="upper center", bbox_to_anchor=(0.5, 1.18)) + return _png(fig) + + +def chart_by_level(MT, fam: str) -> bytes | None: + lv = sorted({k for k in MT["by_lvl"] if k.startswith(fam + ":")}, key=lambda s: int(s.split(":d")[1])) + if len(lv) < 2: + return None + fig, ax = plt.subplots(figsize=(6.5, 3.4)) + _style(ax) + xs = [int(s.split(":d")[1]) for s in lv] + for m in MT["models"]: + ys = [(sum(MT["by_lvl"][s][m]) / len(MT["by_lvl"][s][m])) if MT["by_lvl"][s].get(m) else None for s in lv] + pts = [(x, y) for x, y in zip(xs, ys) if y is not None] + if len(pts) < 2: + continue + ax.plot(*zip(*pts), color=COLOR.get(m, "#888"), linewidth=2, marker="o", markersize=5, + markeredgecolor=SURF, markeredgewidth=1.5, label=m) + ax.annotate(m, pts[-1], xytext=(6, 0), textcoords="offset points", fontsize=8, color=INK2, va="center") + ax.set_xticks(xs) + ax.set_xlabel("difficulty level", color=INK2, fontsize=9) + ax.set_ylabel("accuracy", color=INK2, fontsize=9) + ax.set_ylim(-0.03, 1.05) + ax.legend(frameon=False, fontsize=8, loc="lower left") + return _png(fig) + + +def chart_funnel(rej: dict) -> bytes | None: + if not rej: + return None + items = sorted(rej.items(), key=lambda kv: kv[1]) + fig, ax = plt.subplots(figsize=(6, 0.45 * len(items) + 0.8)) + _style(ax) + ax.xaxis.grid(True, color=GRID); ax.yaxis.grid(False) + ax.barh([k for k, _ in items], [v for _, v in items], color="#2a78d6", height=0.6, edgecolor=SURF) + for i, (k, v) in enumerate(items): + ax.text(v, i, f" {v}", va="center", fontsize=8, color=INK) + ax.set_xlabel("rejected candidates", color=INK2, fontsize=9) + return _png(fig) + + +def _tbl(header, rows) -> str: + out = "| " + " | ".join(header) + " |\n|" + "---|" * len(header) + "\n" + for r in rows: + out += "| " + " | ".join(str(x) for x in r) + " |\n" + return out + + +def _pct(w): + return f"{w[0]:.0%} ({w[1]:.0%}–{w[2]:.0%})" if w else "—" + + +def build_report(run_dirs: list[Path], out_dir: Path, title: str = "NEEDLEPOINT evidence report") -> Path: + out_dir = Path(out_dir) + assets = out_dir / "report_assets" + assets.mkdir(parents=True, exist_ok=True) + run_dirs = [Path(r) for r in run_dirs] + ablation_dirs = [r for r in run_dirs if (r / "ablation_manifest.json").exists()] + main_runs = [r for r in run_dirs if r not in ablation_dirs] # ablation tasks never pool into main tables + C = collect(main_runs) + MT = model_tables(C) + md = [f"# {title}\n", f"Runs: {', '.join(str(r) for r in run_dirs)} · tasks: {len(C['tasks'])} · " + f"models: {', '.join(MT['models']) or 'none'}\n"] + imgs: dict[str, bytes] = {} + + # factory + validation + rej = Counter() + md.append("## Factory\n") + for rd in run_dirs: + for name in ("metrics.json", "wiring_metrics.json"): + p = Path(rd) / name + if p.exists(): + m = json.loads(p.read_text()) + if name == "metrics.json": + rej.update(m.get("rejections_by_gate", {})) + md.append(f"- `{rd}`: {m['accepted']} accepted of {m['candidates']} candidates " + f"(acceptance {m['acceptance_rate']:.0%}), {m.get('tasks_per_second')} tasks/s, " + f"{m.get('balance_skips', 0)} balance skips, ops {m['ops']}\n") + else: + for lv, s in m.items(): + rej.update(s.get("rejections", {})) + md.append(f"- `{rd}`: wiring levels {', '.join(f'L{k}: {v['accepted']} acc / {v['rejected']} rej' for k, v in m.items())}\n") + f = chart_funnel(dict(rej)) + if f: + imgs["funnel.png"] = f + md.append("\n![Rejections by gate](report_assets/funnel.png)\n\n" + _tbl(["gate", "rejections"], sorted(rej.items(), key=lambda kv: -kv[1]))) + for rd in run_dirs: + p = Path(rd) / "faults_report.json" + if p.exists(): + fr = json.loads(p.read_text()) + g = fr["gate_fault_injection"] + md.append("\n## Verifying the verifiers\n") + md.append(_tbl(["planted defect", "n", "recall (any gate)", "recall (intended gate)", "intended gate"], + [[k, v["n"], f"{v['recall_any_gate']:.0%}", f"{v['recall_intended_gate']:.0%}", v["intended_gate"]] + for k, v in g["classes"].items()])) + md.append(f"\nClean candidates wrongly rejected: {g['clean']['false_rejection_rate']:.1%} (n = {g['clean']['n']}). " + f"Checker mutation tests: {fr['checker_mutation'].get('n_checks', '—')} checks, all correct: {fr['checker_mutation'].get('all_ok')}.\n") + + # variation + md.append("\n## Meaningful variation (ledger)\n") + for rd in main_runs: + L = build_ledger(Path(rd)) + s = L["structural"] + md.append(f"- `{rd}`: {L['n_tasks']} tasks · {s['unique_signatures']} distinct structural signatures " + f"(effective {s['effective_number_of_signatures']}, normalized entropy {s['normalized_entropy']}) · " + f"true duplicates {L['duplicates']['true_duplicates']} · designed twin pairs {L['duplicates']['designed_twin_pairs']} · " + f"reasoning steps {L['reasoning_steps']}\n") + bal = {g: v["chi2_p_uniform"] for g, v in L["answer_balance"].items() if v["chi2_p_uniform"] is not None} + if bal: + md.append(f" - answer balance χ² p-values (uniform): {bal}\n") + md.append(f" - surface variation (tracked, *not* counted as meaningful): {L['surface_variation_not_counted']}\n") + + # models + if MT["models"]: + md.append("\n## Model results\n") + imgs["by_op.png"] = chart_by_op(MT) + md.append("![Accuracy by question type](report_assets/by_op.png)\n\n") + ops = sorted(MT["by_op"]) + md.append(_tbl(["question type"] + MT["models"], + [[op] + [_pct(wilson(int(sum(MT['by_op'][op][m])), len(MT['by_op'][op][m]))) + f" n={len(MT['by_op'][op][m])}" + if MT["by_op"][op].get(m) else "—" for m in MT["models"]] for op in ops])) + for fam in ("instruments", "wiring"): + ch = chart_by_level(MT, fam) + if ch: + imgs[f"level_{fam}.png"] = ch + lv = sorted({k for k in MT["by_lvl"] if k.startswith(fam + ":")}, key=lambda s: int(s.split(":d")[1])) + md.append(f"\n### {fam}: accuracy by difficulty\n\n![{fam} by level](report_assets/level_{fam}.png)\n\n") + md.append(_tbl(["level"] + MT["models"], + [[s.split(':')[1]] + [f"{sum(MT['by_lvl'][s][m]):.0f}/{len(MT['by_lvl'][s][m])}" if MT['by_lvl'][s].get(m) else "—" + for m in MT["models"]] for s in lv])) + md.append("\n### Baselines, consistency and cost\n") + md.append(_tbl(["model", "answers", "twin pairs both correct", "text-only (blind) accuracy", "cost (USD)", "USD / task"], + [[m, MT["n"][m], _pct(MT["twin"].get(m)), _pct(MT["blind"].get(m)), f"{MT['cost'][m]:.3f}", + f"{MT['cost'][m] / max(1, MT['n'][m]):.4f}"] for m in MT["models"]])) + md.append("\n### Why models fail (automatic error attribution, instruments)\n") + for m in MT["models"]: + top = MT["attrib"][m].most_common(6) + if top: + md.append(f"- **{m}**: " + ", ".join(f"`{k}` ×{v}" for k, v in top) + "\n") + + # human + ablation + for rd in run_dirs: + p = Path(rd) / "human_check_pilot" / "score.json" + if not p.exists(): + p = Path(rd) / "human_check" / "score.json" + if p.exists(): + h = json.loads(p.read_text()) + md.append(f"\n## Blind human audit (pilot set)\n\nHuman: {h['correct']:.0f}/{h['n']} ({h['accuracy']:.0%}) on 30 random pilot tasks. Misses: " + "2 human slips and 1 generator defect (a red liquid fill read as an alarm zone), since fixed by gate G8.\n") + p = Path(rd) / "ablation_report.json" + if p.exists(): + a = json.loads(p.read_text()) + md.append("\n## Surface vs structure ablation\n\nSame reading and answer; only colours (surface) or only geometry (structure) changed.\n\n") + md.append(_tbl(["model", "triples", "acc base", "acc surface", "acc structure", "flip rate surface", "flip rate structure"], + [[m, v["n_triples"], _pct(v["acc_base"]), _pct(v["acc_surface"]), _pct(v["acc_structure"]), + _pct(v["correctness_flip_rate_surface"]), _pct(v["correctness_flip_rate_structure"])] for m, v in a.items()])) + md.append("\n## Limitations\n- Synthetic, schematic renders; findings describe these task families, not photographs.\n" + "- Decoders read only pixels + layout box but share the developer's semantics; the human audit is the independent check.\n" + "- Small cells: read differences together with their confidence intervals.\n") + for name, data in imgs.items(): + (assets / name).write_bytes(data) + text = "".join(md) + (out_dir / "report.md").write_text(text) + (out_dir / "report.html").write_text(_html(title, text, imgs)) + return out_dir / "report.html" + + +def _html(title: str, md: str, imgs: dict) -> str: + """Minimal Markdown -> HTML (headings, lists, tables, images, bold, code) with inlined images.""" + out, in_tbl, in_ul = [], False, False + import re + + def inline(s): + s = H.escape(s) + s = re.sub(r"\*\*(.+?)\*\*", r"\1", s) + s = re.sub(r"`(.+?)`", r"\1", s) + return s + for line in md.splitlines(): + if line.startswith("|"): + cells = [c.strip() for c in line.strip("|").split("|")] + if set("".join(cells)) <= set("-"): + continue + if not in_tbl: + out.append("" + "".join(f"" for c in cells) + "") + in_tbl = True + else: + out.append("" + "".join(f"" for c in cells) + "") + continue + if in_tbl: + out.append("
{inline(c)}
{inline(c)}
"); in_tbl = False + if line.startswith("- ") or line.startswith(" - "): + if not in_ul: + out.append("
    "); in_ul = True + out.append(f"
  • {inline(line.strip()[2:])}
  • ") + continue + if in_ul: + out.append("
"); in_ul = False + m = re.match(r"!\[(.*?)\]\(report_assets/(.+?)\)", line) + if m: + b64 = base64.b64encode(imgs[m.group(2)]).decode() + out.append(f'
{H.escape(m.group(1))}
') + elif line.startswith("#"): + lvl = len(line) - len(line.lstrip("#")) + out.append(f"{inline(line.lstrip('#').strip())}") + elif line.strip(): + out.append(f"

{inline(line)}

") + if in_tbl: + out.append("") + if in_ul: + out.append("") + css = ("body{font-family:system-ui,sans-serif;max-width:1100px;margin:0 auto;padding:16px;background:#fcfcfb;color:#0b0b0b}" + "table{border-collapse:collapse;margin:8px 0;font-size:14px;display:block;overflow-x:auto}" + "th,td{border:1px solid #e6e5e1;padding:4px 8px;text-align:left}th{background:#f0efec}" + "img{max-width:100%;height:auto}code{background:#f0efec;padding:0 3px;border-radius:3px}") + return (f'' + f"{H.escape(title)}" + "\n".join(out) + "") diff --git a/needlepoint/server.py b/needlepoint/server.py new file mode 100644 index 0000000000000000000000000000000000000000..bc64f6bbeed29793a5a9c265438be7d99b5d5e81 --- /dev/null +++ b/needlepoint/server.py @@ -0,0 +1,468 @@ +"""NEEDLEPOINT Studio: REST API + local web app. + +Run: needlepoint serve (http://127.0.0.1:8000, interactive API docs at /docs) +Everything is local; no data leaves the machine except optional model-evaluation calls made +from the CLI with the user's own keys (the Studio never calls model APIs). +""" +from __future__ import annotations + +import base64 +import io +import json +import math +import re +import secrets +import shutil +import tempfile +import time +import zipfile +from collections import Counter +from pathlib import Path +from typing import Literal, Optional + +import numpy as np +from fastapi import FastAPI, HTTPException, Query +from fastapi.responses import FileResponse, JSONResponse, Response, StreamingResponse +from fastapi.staticfiles import StaticFiles +from pydantic import BaseModel, Field + +from . import __version__, gates, wiring +from . import panel as P +from .analysis import wilson +from .evaluate import PRICES, PROVIDER +from .faults import INTENDED, inject +from .spec import Panel + +ROOT = Path(__file__).resolve().parent.parent +STATIC = ROOT / "studio" / "static" +RUNS = ROOT / "runs" / "studio" +EVIDENCE = ROOT / "evidence" / "final" +RUN_ID = re.compile(r"^[a-z0-9-]{4,40}$") +KEEP_RUNS = 25 # Studio retention: generated runs beyond the newest 25 are pruned automatically +TASK_ID = re.compile(r"^[a-z0-9-]{4,40}$") + +app = FastAPI( + title="NEEDLEPOINT Studio API", + version=__version__, + description="Generate certified visual evaluation tasks (instrument panels, wiring), inspect their proofs, " + "stress-test the validators, explore measured model capabilities, and export datasets " + "(JSONL, Harbor 0.25). Runs fully offline.", +) + + +# ----------------------------------------------------------------------------- models +class GenerateRequest(BaseModel): + family: Literal["instruments", "wiring"] = "instruments" + n: int = Field(8, ge=1, le=48, description="instruments: number of tasks; wiring: tasks per level") + seed: Optional[int] = Field(None, description="omit for a random seed") + difficulty: list[int] = Field(default_factory=lambda: [1, 2, 3]) + profile: Literal["industrial", "healthcare"] = "industrial" + + +class FaultRequest(BaseModel): + kind: Literal["occluded", "illegible", "near_threshold", "wrong_key", "leak", "missing_glyph"] + seed: Optional[int] = None + + +class EstimateRequest(BaseModel): + n_tasks: int = Field(1000, ge=1, le=10_000_000) + models: list[str] = Field(default_factory=lambda: ["gpt-6.2-astra", "claude-opus-5-5"]) + reasoning: Literal["low", "high"] = "low" + batch: bool = False + + +# ----------------------------------------------------------------------------- helpers +def _run_dir(run_id: str) -> Path: + if not RUN_ID.match(run_id): + raise HTTPException(400, "bad run id") + if run_id == "final-instruments": + return EVIDENCE / "instruments" + d = RUNS / run_id + if not d.exists(): + raise HTTPException(404, "run not found") + return d + + +def _task_dir(run_id: str, task_id: str) -> Path: + if not TASK_ID.match(task_id): + raise HTTPException(400, "bad task id") + d = _run_dir(run_id) / "tasks" / task_id + if not d.exists(): + raise HTTPException(404, "task not found") + return d + + +def _summary(run_id: str, d: Path) -> dict: + t = json.loads((d / "task.json").read_text()) + c = json.loads((d / "certificate.json").read_text()) + sig = c.get("variation_signature", {}) + return {"task_id": d.name, "run_id": run_id, "family": c.get("family", "instruments"), "op": c["op"], + "difficulty": sig.get("difficulty"), "question": t["question"], "answer_type": t["answer_type"], + "image_url": f"/api/tasks/{run_id}/{d.name}/image.png", "has_image": (d / "image.png").exists(), + "twin_id": (c.get("twin") or {}).get("twin_id") or (c.get("twin") or {}).get("twin_of"), + "alt": _alt_text(c)} + + +def _alt_text(cert: dict) -> str: + """Accessible description of the image's layout (never its readings or the answer).""" + if cert.get("family") == "wiring": + s = cert["spec"] + return f"Wiring diagram: {s['n']} wires between terminal blocks L1–L{s['n']} and R1–R{s['n']}, with crossings." + spec = cert.get("spec") or {} + insts = spec.get("instruments", []) + kinds = Counter(i["kind"] for i in insts) + names = {"dial": "dial gauge", "linear": "linear gauge", "digital": "digital display"} + parts = [f"{v} {names[k]}{'s' if v > 1 else ''}" for k, v in kinds.items()] + tags = ", ".join(i["tag"] for i in insts) + return f"Instrument panel with {', '.join(parts)}. Tags: {tags}." + + +def _jsonable(obj): + """Convert NumPy scalars/arrays (from decoders) into plain JSON types.""" + def conv(o): + if isinstance(o, np.generic): + return o.item() + if isinstance(o, np.ndarray): + return o.tolist() + raise TypeError(type(o).__name__) + return json.loads(json.dumps(obj, default=conv)) + + +def _png_b64(img) -> str: + buf = io.BytesIO() + img.save(buf, "PNG") + return "data:image/png;base64," + base64.b64encode(buf.getvalue()).decode() + + +# ----------------------------------------------------------------------------- endpoints +@app.get("/api/health") +def health(): + return {"status": "ok", "version": __version__} + + +@app.get("/api/meta") +def meta(): + """Capabilities, vocabularies and headline evidence for the UI.""" + led = {} + for s in ("instruments", "healthcare", "wiring"): + p = EVIDENCE / s / "ledger.json" + if p.exists(): + led[s] = json.loads(p.read_text())["n_tasks"] + faults = EVIDENCE / "instruments" / "faults_report.json" + fr = json.loads(faults.read_text())["gate_fault_injection"]["classes"] if faults.exists() else {} + hv = EVIDENCE / "harbor_validation" / "results.tsv" + hv_ok = hv_n = 0 + if hv.exists(): + for line in hv.read_text().splitlines(): + _, _, a, r = line.split("\t") + hv_n += 1 + hv_ok += (a == "nop" and r == "0.0") or (a == "oracle" and r == "1.0") + return { + "version": __version__, + "families": {"instruments": {"difficulties": [1, 2, 3, 4, 5], "profiles": ["industrial", "healthcare"], + "ops": ["READ", "THRESH", "COMPARE", "DIFF", "COUNT_ALARM", "SCALE", "BIND", "ABSTAIN"]}, + "wiring": {"difficulties": [1, 2, 3, 4, 5, 6], "ops": ["TRACE"]}}, + "gates": [{"id": "G0_determinism", "label": "Deterministic re-render"}, + {"id": "G1_glyphs", "label": "Glyph coverage"}, + {"id": "G2_legibility", "label": "Legibility"}, + {"id": "G3_visibility", "label": "Evidence visible"}, + {"id": "G4_decoder", "label": "Image-only decoder agrees"}, + {"id": "G5_margin", "label": "Decision margin"}, + {"id": "G6_leak", "label": "No answer leak"}, + {"id": "G8_reserved_red", "label": "Red reserved for alarms"}, + {"id": "W1_crossing_angle", "label": "Crossings ≥ 22°"}, + {"id": "W2_image_tracer", "label": "Image-only tracer agrees"}, + {"id": "W3_legibility", "label": "Terminal labels legible"}, + {"id": "W4_leak", "label": "No answer leak (wiring)"}], + "fault_kinds": [{"kind": k, "intended_gate": v} for k, v in INTENDED.items()], + "evidence": {"final_tasks": sum(led.values()), "by_set": led, + "fault_recall": {k: v["recall_intended_gate"] for k, v in fr.items()}, + "harbor_checks": f"{hv_ok}/{hv_n}"}, + } + + +@app.post("/api/generate") +def generate(req: GenerateRequest): + """Generate a small certified batch (all gates must pass). Returns tasks, funnel and rejections.""" + from .factory import generate as gen_instruments + seed = req.seed if req.seed is not None else secrets.randbelow(10 ** 6) + run_id = f"{req.family[:4]}-{seed}-{secrets.token_hex(3)}" + out = RUNS / run_id + t0 = time.perf_counter() + if req.family == "wiring": + levels = tuple(sorted({d for d in req.difficulty if 1 <= d <= 6})) or (1, 2, 3) + m = wiring.generate(out, per_level=max(1, req.n // len(levels)), levels=levels, seed=seed, log=lambda *_: None) + rej = Counter() + for v in m.values(): + rej.update(v["rejections"]) + accepted = sum(v["accepted"] for v in m.values()) + candidates = accepted + sum(v["rejected"] for v in m.values()) + rejections = [] + else: + diffs = tuple(sorted({d for d in req.difficulty if 1 <= d <= 5})) or (1, 2, 3) + m = gen_instruments(out, req.n, seed=seed, profile=req.profile, difficulties=diffs, log=lambda *_: None) + rej = Counter(m["rejections_by_gate"]) + accepted, candidates = m["accepted"], m["candidates"] + log = out / "rejection_log.jsonl" + rejections = [json.loads(x) for x in log.read_text().splitlines() if x.strip()][:50] if log.exists() else [] + tasks = [_summary(run_id, d) for d in sorted((out / "tasks").iterdir()) if d.is_dir()] + prune_runs() + return {"run_id": run_id, "seed": seed, "family": req.family, "tasks": tasks, + "metrics": {"accepted": accepted, "candidates": candidates, "seconds": round(time.perf_counter() - t0, 2), + "rejections_by_gate": dict(rej)}, + "rejections": rejections} + + +def prune_runs(keep: int = KEEP_RUNS) -> int: + """Delete all but the newest `keep` Studio runs. Returns how many were removed.""" + if not RUNS.exists(): + return 0 + runs_ = sorted((d for d in RUNS.iterdir() if d.is_dir() and RUN_ID.match(d.name)), + key=lambda p: p.stat().st_mtime, reverse=True) + for d in runs_[keep:]: + shutil.rmtree(d, ignore_errors=True) + return max(0, len(runs_) - keep) + + +@app.get("/api/runs") +def runs(): + out = [] + if RUNS.exists(): + for d in sorted(RUNS.iterdir(), key=lambda p: p.stat().st_mtime, reverse=True)[:50]: + if (d / "tasks").exists(): + out.append({"run_id": d.name, "n_tasks": sum(1 for _ in (d / "tasks").iterdir())}) + return {"runs": out} + + +@app.get("/api/runs/{run_id}") +def run_tasks(run_id: str): + d = _run_dir(run_id) + return {"run_id": run_id, "tasks": [_summary(run_id, t) for t in sorted((d / "tasks").iterdir()) if t.is_dir()]} + + +@app.get("/api/tasks/{run_id}/{task_id}") +def task(run_id: str, task_id: str, reveal: bool = Query(False, description="include the answer key")): + d = _task_dir(run_id, task_id) + c = json.loads((d / "certificate.json").read_text()) + out = {**_summary(run_id, d), + "certificate": {k: c.get(k) for k in ("generator", "spec_hash", "image_sha256", "gates", "trace", + "variation_signature", "decoder_reads", "targets", "twin", + "tracer_full_agreement")}} + if reveal: + out["answer"] = json.loads((d / "answer.json").read_text()) + return out + + +@app.get("/api/tasks/{run_id}/{task_id}/image.png") +def task_image(run_id: str, task_id: str): + d = _task_dir(run_id, task_id) + if not (d / "image.png").exists(): + raise HTTPException(404, "image not stored for this task (regenerate from seed)") + return FileResponse(d / "image.png", media_type="image/png") + + +@app.get("/api/tasks/{run_id}/{task_id}/proof") +def task_proof(run_id: str, task_id: str): + """What the image-only decoder read, as shapes in image pixel coordinates (for an SVG overlay).""" + from PIL import Image + d = _task_dir(run_id, task_id) + c = json.loads((d / "certificate.json").read_text()) + ans = json.loads((d / "answer.json").read_text()) + img = Image.open(d / "image.png").convert("RGB") + shapes, verdicts = [], [] + if c.get("family") == "wiring": + tr = wiring.trace(img) + q = f"L{c['spec']['query'] + 1}" + if tr.get("ok"): + shapes.append({"type": "polyline", "points": tr["paths"][q], "role": "trace"}) + got = tr["mapping"][q] + verdicts.append({"target": q, "decoded": got, "expected": ans["answer"], "agree": got == ans["answer"]}) + else: + verdicts.append({"target": q, "decoded": None, "expected": ans["answer"], "agree": False, "note": tr.get("reason")}) + else: + panel = Panel(**c["spec"]) + for i, inst in enumerate(panel.instruments): + if inst.tag not in c["targets"]: + continue + dec = P.decode(img, inst) + x0, y0, x1, y1 = inst.box + shapes.append({"type": "rect", "x": x0, "y": y0, "w": x1 - x0, "h": y1 - y0, "role": "target", "label": inst.tag}) + det = dec.details or {} + if inst.covered or not dec.ok or dec.value is None: + verdicts.append({"target": inst.tag, "decoded": None, "expected": "no readable indicator" if inst.covered else inst.value, + "agree": bool(inst.covered and (not dec.ok or dec.value is None)), "note": dec.reason}) + continue + if inst.kind == "dial": + (cx, cy), R = det["center"], det["radius"] + shapes.append({"type": "circle", "cx": cx, "cy": cy, "r": R, "role": "face"}) + for t in det["ticks_deg"]: + a = math.radians(t) + shapes.append({"type": "dot", "cx": cx + 0.815 * R * math.cos(a), "cy": cy - 0.815 * R * math.sin(a), "role": "tick"}) + a = math.radians(det["needle_deg"]) + shapes.append({"type": "line", "x1": cx, "y1": cy, "x2": cx + 0.92 * R * math.cos(a), "y2": cy - 0.92 * R * math.sin(a), "role": "needle"}) + elif inst.kind == "linear": + tx0, ty0, tx1, ty1 = det["tube"] + shapes.append({"type": "rect", "x": tx0, "y": ty0, "w": tx1 - tx0, "h": ty1 - ty0, "role": "face"}) + for r in det["tick_rows"]: + shapes.append({"type": "dot", "cx": tx0 - 6, "cy": r, "role": "tick"}) + shapes.append({"type": "line", "x1": tx0 - 14, "y1": det["fill_top_y"], "x2": tx1 + 14, "y2": det["fill_top_y"], "role": "needle"}) + else: + rx0, ry0, rx1, ry1 = det["display"] + shapes.append({"type": "rect", "x": rx0, "y": ry0, "w": rx1 - rx0, "h": ry1 - ry0, "role": "face"}) + for bx in det.get("label_boxes", []): + shapes.append({"type": "rect", "x": bx[0], "y": bx[1], "w": bx[2] - bx[0], "h": bx[3] - bx[1], "role": "ocr", "label": bx[4]}) + tol = inst.tolerance() + verdicts.append({"target": inst.tag, "decoded": round(dec.value, 4), "expected": inst.value, "tolerance": tol, + "unit": inst.scale.unit, "agree": abs(dec.value - inst.value) <= tol, + "alarm_decoded": dec.alarm, "alarm_expected": inst.in_alarm()}) + return _jsonable({"width": img.width, "height": img.height, "shapes": shapes, "verdicts": verdicts}) + + +@app.post("/api/faults/inject") +def faults(req: FaultRequest): + """Plant one known defect into a fresh candidate and show which gates reject it.""" + seed = req.seed if req.seed is not None else secrets.randbelow(10 ** 6) + rng = np.random.default_rng(seed) + for k in range(60): + got = inject(req.kind, 70_000_000 + seed + k, rng) + if got: + break + else: + raise HTTPException(500, "could not build a candidate") + panel, img, q, ov = got + rep = gates.run_all(panel, img, q, ov) + clean = P.render(panel) + return _jsonable({"kind": req.kind, "intended_gate": INTENDED[req.kind], "question": q.text, + "caught": not rep["passed"], "caught_by": rep["failed"], "gates": rep["gates"], + "image": _png_b64(img), "clean_image": _png_b64(clean)}) + + +@app.get("/api/results") +def results(): + """Measured capability map from the frozen final evaluation (evidence/final).""" + from .report import collect, model_tables + from .ablation import ablation_report + runs_ = [EVIDENCE / s for s in ("instruments", "healthcare", "wiring") if (EVIDENCE / s).exists()] + if not runs_: + return {"available": False} + MT = model_tables(collect(runs_)) + def cell(v): + return [*wilson(int(sum(v)), len(v)), len(v)] if v else None + acc = {op: {m: cell(MT["by_op"][op].get(m)) for m in MT["models"]} for op in sorted(MT["by_op"])} + levels = {} + for key, per in MT["by_lvl"].items(): + fam, lv = key.split(":d") + for m, v in per.items(): + levels.setdefault(fam, {}).setdefault(m, {})[int(lv)] = round(sum(v) / len(v), 4) + totals = {} + for m in MT["models"]: + allv = [x for op in MT["by_op"] for x in MT["by_op"][op].get(m, [])] + totals[m] = cell(allv) + abl = {} + if (EVIDENCE / "ablation" / "ablation_report.json").exists(): + abl = json.loads((EVIDENCE / "ablation" / "ablation_report.json").read_text()) + human = EVIDENCE / "human_check_pilot" / "score.json" + return {"available": True, "models": MT["models"], "accuracy_by_op": acc, "accuracy_by_level": levels, + "overall": totals, "blind": MT["blind"], "twin_both_correct": MT["twin"], + "cost_per_task": {m: round(MT["cost"][m] / max(1, MT["n"][m]), 5) for m in MT["models"]}, + "attribution": {m: dict(MT["attrib"][m].most_common(8)) for m in MT["models"]}, + "ablation": abl, "human": json.loads(human.read_text()) if human.exists() else None} + + +@app.post("/api/estimate") +def estimate(req: EstimateRequest): + """Cost to evaluate N tasks on chosen models (generation itself has no API cost).""" + rows, total = [], 0.0 + out_tok = 120 if req.reasoning == "low" else 1500 + measured = _measured_costs() + for m in req.models: + if m not in PRICES: + raise HTTPException(400, f"unknown model {m}") + pi, po = PRICES[m] + if m in measured and req.reasoning == "low": + per, basis = measured[m], "measured (final evaluation, low reasoning)" + else: + per, basis = (1650 * pi + out_tok * po) / 1e6, "price-list formula" + per *= 0.5 if req.batch else 1.0 + rows.append({"model": m, "provider": PROVIDER[m], "usd_per_task": round(per, 5), + "usd_total": round(per * req.n_tasks, 2), "basis": basis}) + total += per * req.n_tasks + cpu_s = req.n_tasks / 9.0 + return {"n_tasks": req.n_tasks, "rows": rows, "usd_total": round(total, 2), "generation_usd": 0.0, + "generation_cpu_minutes": round(cpu_s / 60, 1), + "assumptions": "≈1,650 input tokens per task (image + prompt); output 120 tokens at low reasoning, 1,500 at high; " + "batch = 50% discount; generation ≈ 9 certified tasks/s/core (measured with balancing)."} + + +_MEASURED: dict | None = None + + +def _measured_costs() -> dict: + """Mean USD per task actually billed in the frozen final evaluation (image mode).""" + global _MEASURED + if _MEASURED is None: + tot, n = Counter(), Counter() + for f in EVIDENCE.glob("*/eval/cache/*/*__image.json"): + r = json.loads(f.read_text()) + tot[r["model"]] += r.get("cost_usd", 0.0) + n[r["model"]] += 1 + _MEASURED = {m: tot[m] / n[m] for m in n if n[m]} + return _MEASURED + + +@app.get("/api/models") +def models(): + return {"models": [{"id": m, "provider": PROVIDER[m], "usd_per_mtok_in": PRICES[m][0], "usd_per_mtok_out": PRICES[m][1]} for m in PRICES]} + + +@app.get("/api/export/{run_id}") +def export(run_id: str, format: Literal["jsonl", "harbor", "bundle"] = "bundle"): + """Download a run as a zip: `jsonl` (dataset.jsonl + images), `harbor` (Harbor 0.25 packages) or `bundle` (task folders).""" + from .harbor_export import export_task + d = _run_dir(run_id) + buf = io.BytesIO() + with zipfile.ZipFile(buf, "w", zipfile.ZIP_DEFLATED) as z: + tasks = sorted(p for p in (d / "tasks").iterdir() if p.is_dir()) + if format == "jsonl": + lines = [] + for t in tasks: + tj = json.loads((t / "task.json").read_text()) + aj = json.loads((t / "answer.json").read_text()) + cj = json.loads((t / "certificate.json").read_text()) + lines.append(json.dumps({"id": t.name, "image": f"images/{t.name}.png", "question": tj["question"], + "answer": aj["answer"], "answer_type": aj["answer_type"], "tolerance": aj["tolerance"], + "op": cj["op"], "family": cj.get("family", "instruments"), + "difficulty": cj.get("variation_signature", {}).get("difficulty"), + "image_sha256": cj["image_sha256"]})) + if (t / "image.png").exists(): + z.write(t / "image.png", f"images/{t.name}.png") + z.writestr("dataset.jsonl", "\n".join(lines) + "\n") + z.writestr("README.txt", "NEEDLEPOINT dataset export. One JSON object per line; images in images/. " + "Answers are included: keep this file away from models under test.\n") + elif format == "harbor": + with tempfile.TemporaryDirectory() as td: + for t in tasks: + if (t / "image.png").exists(): + p = export_task(t, Path(td)) + for f in p.rglob("*"): + if f.is_file(): + z.write(f, f"harbor/{p.name}/{f.relative_to(p)}") + else: + for t in tasks: + for f in t.iterdir(): + z.write(f, f"tasks/{t.name}/{f.name}") + buf.seek(0) + return StreamingResponse(buf, media_type="application/zip", + headers={"Content-Disposition": f'attachment; filename="needlepoint-{run_id}-{format}.zip"'}) + + +@app.get("/", include_in_schema=False) +def index(): + p = STATIC / "index.html" + if not p.exists(): + return JSONResponse({"message": "Studio UI not built; API docs at /docs"}) + return FileResponse(p) + + +if STATIC.exists(): + app.mount("/static", StaticFiles(directory=STATIC), name="static") diff --git a/needlepoint/spec.py b/needlepoint/spec.py new file mode 100644 index 0000000000000000000000000000000000000000..9d37714285491370bba8494186a6a93527982be0 --- /dev/null +++ b/needlepoint/spec.py @@ -0,0 +1,123 @@ +"""Ground-truth-first specification of a panel of instruments. + +Everything the renderer draws and every answer the question programs compute +comes from these models. Models under test never see them. +""" +from __future__ import annotations + +import hashlib +import json +import math +from typing import Literal, Optional + +from pydantic import BaseModel, Field + +Kind = Literal["dial", "linear", "digital"] + + +class Scale(BaseModel): + vmin: float + vmax: float + major_step: float + minor_per: int = 1 # minor divisions per major interval (1 = no minor ticks) + unit: str + factor: float = 1.0 # printed multiplier, e.g. "×100" -> 100 + decimals: int = 0 # label / display decimals + + @property + def minor(self) -> float: + return self.major_step / self.minor_per + + @property + def n_major(self) -> int: + return int(round((self.vmax - self.vmin) / self.major_step)) + + def fraction(self, v: float) -> float: + return (v - self.vmin) / (self.vmax - self.vmin) + + def major_values(self) -> list[float]: + return [round(self.vmin + i * self.major_step, 9) for i in range(self.n_major + 1)] + + def fmt(self, v: float) -> str: + s = f"{v:.{self.decimals}f}" + return "0" if s in ("-0", "-0.0", "-0.00") else s + + +class Band(BaseModel): + """Alarm band: the instrument is 'in alarm' when lo <= value <= hi.""" + lo: float + hi: float + + def contains(self, v: float) -> bool: + return self.lo <= v <= self.hi + + +class Instrument(BaseModel): + kind: Kind + tag: str + scale: Scale + value: float + bands: list[Band] = Field(default_factory=list) + geom: dict = Field(default_factory=dict) # kind-specific geometry (structural variation) + style: dict = Field(default_factory=dict) # colours / fonts (surface variation) + box: tuple[int, int, int, int] = (0, 0, 0, 0) # x0, y0, x1, y1 in panel pixels + covered: bool = False # indicator hidden by a maintenance tag (ABSTAIN) + + def in_alarm(self, v: Optional[float] = None) -> bool: + v = self.value if v is None else v + return any(b.contains(v) for b in self.bands) + + def actual(self, v: Optional[float] = None) -> float: + """Physical quantity after applying a printed multiplier (e.g. ×100).""" + return (self.value if v is None else v) * self.scale.factor + + def resolution(self) -> float: + """Smallest value step a careful reader can resolve on this instrument.""" + if self.kind == "digital": + return 10 ** (-self.scale.decimals) + return self.scale.minor + + def tolerance(self) -> float: + """Answer tolerance: half the readable resolution for analog, exact for digital.""" + if self.kind == "digital": + return 0.5 * 10 ** (-self.scale.decimals) * 0.999 + return 0.5 * self.scale.minor + + def decision_margin_units(self, v: Optional[float] = None) -> float: + """Distance (value units) from v to the nearest alarm-band edge.""" + v = self.value if v is None else v + edges = [e for b in self.bands for e in (b.lo, b.hi) + if self.scale.vmin < e < self.scale.vmax] + return min((abs(v - e) for e in edges), default=math.inf) + + def decision_margin_visual(self, v: Optional[float] = None) -> float: + """Distance to the nearest band edge in *visual* units: degrees for dials, + percent of scale length for linear gauges, display steps for digital.""" + du = self.decision_margin_units(v) + if math.isinf(du): + return du + span = self.scale.vmax - self.scale.vmin + if self.kind == "dial": + return du / span * self.geom["sweep"] + if self.kind == "linear": + return du / span * 100.0 + return du / self.resolution() + + +class Panel(BaseModel): + panel_id: str + seed: int + profile: str + width: int + height: int + background: tuple[int, int, int] + instruments: list[Instrument] + degrade: dict = Field(default_factory=dict) # camera-style degradation (blur, noise, jpeg, light) + generator_version: str = "0.1.0" + + def spec_hash(self) -> str: + blob = json.dumps(self.model_dump(mode="json"), sort_keys=True).encode() + return "sha256:" + hashlib.sha256(blob).hexdigest() + + def by_tag(self, tag: str) -> Instrument: + return next(i for i in self.instruments if i.tag == tag) diff --git a/needlepoint/wiring.py b/needlepoint/wiring.py new file mode 100644 index 0000000000000000000000000000000000000000..4ec07424befd8eab671dcc5d532587aa0e96f3f6 --- /dev/null +++ b/needlepoint/wiring.py @@ -0,0 +1,248 @@ +"""WIRING family: trace a conductor between terminal blocks through crossings. + +Ground truth first: a braid of `n` wires through `cols` shuffle columns (each column a random +permutation of evenly spaced slots; cosine easing between columns). Practical analogues: +control-cabinet wiring, network patch panels, wiring-harness verification. + +Validity: + W1 crossing-angle gate every crossing between two wires is at least MIN_CROSS_DEG + W2 image-only tracer a pixel tracer (momentum through crossings) must reproduce the answer + W3 legibility terminal labels >= 11 px, high contrast (fixed design) + W4 leak the answer label is not in the question +""" +from __future__ import annotations + +import hashlib +import json +import math +from pathlib import Path + +import numpy as np +from PIL import Image, ImageDraw +from scipy import ndimage + +from .fonts import font +from .gates import img_hash + +W, H = 1024, 768 +X_L, X_R = 150, W - 150 +DOT = (200, 170, 60) +INK = (30, 30, 30) +MIN_CROSS_DEG = 22.0 +VERSION = "0.2.0" +LADDER = {1: (4, 3), 2: (6, 5), 3: (8, 8), 4: (10, 11), 5: (12, 14), 6: (14, 18)} + + +def sample(seed: int, n: int, cols: int, jump: int = 1) -> dict: + """Braid of adjacent swaps: at each column a random set of disjoint adjacent slot pairs swap. + Every crossing is a symmetric X (one wire rising, one falling), so crossings are steep.""" + rng = np.random.default_rng(seed) + order = list(range(n)) # order[slot] = wire + slots = [[0] * n] + for i in range(n): + slots[0][i] = i + for _ in range(cols + 1): + # disjoint swap intervals [s, s+k], 1 <= k <= jump: the two end wires exchange slots while + # the wires inside stay level, so every crossing is a steep X or slope-vs-level (never tangent) + s = 0 + while s < n - 1: + k = int(rng.integers(1, min(jump, n - 1 - s) + 1)) + if rng.random() < 0.6: + order[s], order[s + k] = order[s + k], order[s] + s += k + 1 + else: + s += 1 + pos = [0] * n + for slot, wire in enumerate(order): + pos[wire] = slot + slots.append(pos) + q = int(rng.integers(n)) + return {"seed": seed, "n": n, "cols": cols, "jump": jump, "slots": slots, "query": q, "palette": "mono", "stroke": 4} + + +def curves(spec: dict) -> list[np.ndarray]: + n, cols = spec["n"], spec["cols"] + ys = np.linspace(110, H - 110, n) + xs = np.linspace(X_L, X_R, cols + 2) + out = [] + for i in range(n): + pts = [] + for c in range(len(xs) - 1): + ya, yb = ys[spec["slots"][c][i]], ys[spec["slots"][c + 1][i]] + t = np.linspace(0, 1, 120, endpoint=False) + e = (1 - np.cos(np.pi * t)) / 2 + pts.append(np.stack([xs[c] + t * (xs[c + 1] - xs[c]), ya + e * (yb - ya)], axis=1)) + pts.append(np.array([[xs[-1], ys[spec["slots"][-1][i]]]])) + out.append(np.concatenate(pts)) + return out + + +def answer(spec: dict) -> str: + return f"R{spec['slots'][-1][spec['query']] + 1}" + + +def question(spec: dict) -> str: + return (f"Follow the wire that starts at terminal L{spec['query'] + 1}. " + "At which right-side terminal does it end? Answer with that terminal's label.") + + +def render(spec: dict) -> Image.Image: + n = spec["n"] + ys = np.linspace(110, H - 110, n) + img = Image.new("RGB", (W, H), (236, 236, 232)) + d = ImageDraw.Draw(img) + for x in (110, W - 110): + d.rounded_rectangle([x - 40, 70, x + 40, H - 70], radius=8, fill=(70, 74, 80)) + for c in curves(spec): + d.line([tuple(p) for p in c], fill=INK, width=spec["stroke"], joint="curve") + for i in range(n): + d.ellipse([X_L - 10, ys[i] - 8, X_L + 6, ys[i] + 8], fill=DOT) + d.ellipse([X_R - 6, ys[i] - 8, X_R + 10, ys[i] + 8], fill=DOT) + d.text((110, ys[i]), f"L{i + 1}", fill=(250, 250, 250), font=font(16, "bold"), anchor="mm") + d.text((W - 110, ys[i]), f"R{i + 1}", fill=(250, 250, 250), font=font(16, "bold"), anchor="mm") + return img + + +# ----------------------------------------------------------------------------- gates +def min_crossing_angle(spec: dict) -> float: + cs = curves(spec) + best = 180.0 + for i in range(len(cs)): + for j in range(i + 1, len(cs)): + a, b = cs[i], cs[j] + diff = a[:, 1] - b[:, 1] + idx = np.nonzero(np.sign(diff[:-1]) * np.sign(diff[1:]) < 0)[0] + for k in idx: + sa = (a[k + 1, 1] - a[k, 1]) / (a[k + 1, 0] - a[k, 0]) + sb = (b[k + 1, 1] - b[k, 1]) / (b[k + 1, 0] - b[k, 0]) + ang = abs(math.degrees(math.atan(sa) - math.atan(sb))) + best = min(best, ang) + return best + + +def trace(img: Image.Image) -> dict: + """Image-only tracer. Finds terminal dots, then follows each wire column by column. On clean + stretches it locks onto the nearest stroke; where strokes merge (a crossing) it coasts on + the incoming slope until they separate.""" + a = np.asarray(img).astype(np.int16) + ink = a.max(axis=2) < 90 + dot = (np.abs(a - np.array(DOT)).sum(axis=2) < 60) + lab, k = ndimage.label(dot) + cents = ndimage.center_of_mass(dot, lab, range(1, k + 1)) + left = sorted(c[0] for c in cents if c[1] < W / 2) + right = sorted(c[0] for c in cents if c[1] > W / 2) + if len(left) != len(right) or len(left) < 2: + return {"ok": False, "reason": "terminals"} + gap = np.median(np.diff(left)) + stroke = 4.0 + runs_by_x = {} + for x in range(X_L + 9, X_R - 8): + lab1, m = ndimage.label(ink[:, x]) + runs = [(int(sl[0].start), int(sl[0].stop) - 1) for sl in ndimage.find_objects(lab1)] if m else [] + merged = [] + for lo, hi in runs: # stroke fragments split by anti-aliasing: re-join tiny gaps + if merged and lo - merged[-1][1] <= 3: + merged[-1] = (merged[-1][0], hi) + else: + merged.append((lo, hi)) + runs_by_x[x] = merged + mapping, paths = {}, {} + for li, y0 in enumerate(left): + y, vy = float(y0), 0.0 + path = [] + for x in range(X_L + 9, X_R - 8): + if x % 4 == 0: + path.append([x, round(y, 1)]) + pred = y + vy + single = stroke * math.sqrt(1 + vy * vy) + abs(vy) + 2 + cand = [(abs((lo + hi) / 2 - pred), lo, hi) for lo, hi in runs_by_x[x] if lo - 4 <= pred <= hi + 4] + if not cand: + y = pred + continue + _, lo, hi = min(cand) + if hi - lo + 1 > 1.7 * single: # merged strokes: crossing -> coast + y = pred + continue + ny = (lo + hi) / 2 + vy = float(np.clip(0.5 * vy + 0.5 * (ny - y), vy - 0.4, vy + 0.4)) # wires bend smoothly + y = ny + rj = int(np.argmin([abs(y - r) for r in right])) + if abs(y - right[rj]) > 0.4 * gap: + return {"ok": False, "reason": f"L{li + 1} lost"} + mapping[f"L{li + 1}"] = f"R{rj + 1}" + paths[f"L{li + 1}"] = path + return {"ok": True, "mapping": mapping, "paths": paths} + + +def gates(spec: dict, img) -> dict: + res = {} + ang = min_crossing_angle(spec) + res["W1_crossing_angle"] = (ang >= MIN_CROSS_DEG, f"min crossing {ang:.1f} deg") + tr = trace(img) + want = answer(spec) + got = tr.get("mapping", {}).get(f"L{spec['query'] + 1}") + res["W2_image_tracer"] = (tr["ok"] and got == want, f"tracer {got} vs {want}" if tr["ok"] else tr["reason"]) + res["W3_legibility"] = (True, "labels 16px bold, contrast > 10:1 (fixed design)") + res["W4_leak"] = (want not in question(spec), "no leak") + return {"passed": all(v[0] for v in res.values()), "failed": [k for k, v in res.items() if not v[0]], + "gates": {k: {"pass": v[0], "detail": v[1]} for k, v in res.items()}, + "tracer_full_agreement": tr.get("mapping") == {f"L{i + 1}": f"R{spec['slots'][-1][i] + 1}" for i in range(spec["n"])} if tr["ok"] else False} + + +# ----------------------------------------------------------------------------- generation +def generate(out: Path, per_level: int = 8, levels=(1, 2, 3, 4, 5, 6), seed: int = 61, log=print, + ladder: dict | None = None) -> dict: + out = Path(out) + stats = {} + k = 0 + ladder = ladder or {k: (*v, 1) for k, v in LADDER.items()} + for lv in levels: + n, cols, jump = ladder[lv] + acc = rej = 0 + reasons = {} + while acc < per_level and k < 100000: + k += 1 + s = seed * 1_000_000 + k + spec = sample(s, n, cols, jump) + img = render(spec) + rep = gates(spec, img) + if not rep["passed"]: + rej += 1 + for f in rep["failed"]: + reasons[f] = reasons.get(f, 0) + 1 + continue + tid = "w-" + hashlib.sha256(f"wiring:{s}".encode()).hexdigest()[:12] + d = out / "tasks" / tid + d.mkdir(parents=True, exist_ok=True) + img.save(d / "image.png") + (d / "task.json").write_text(json.dumps({"task_id": tid, "image": "image.png", "question": question(spec), + "answer_type": "tag", "unit": ""}, indent=2)) + (d / "answer.json").write_text(json.dumps({"answer": answer(spec), "answer_type": "tag", "tolerance": 0.0, "unit": ""}, indent=2)) + n_cross = _n_crossings(spec) + cert = {"task_id": tid, "op": "TRACE", "family": "wiring", "trace": [f"follow L{spec['query'] + 1} -> {answer(spec)}"], + "generator": {"version": VERSION, "seed": s}, + "spec_hash": "sha256:" + hashlib.sha256(json.dumps(spec, sort_keys=True).encode()).hexdigest(), + "image_sha256": img_hash(img), "gates": rep["gates"], "tracer_full_agreement": rep["tracer_full_agreement"], + "variation_signature": {"op": "TRACE", "family": "wiring", "difficulty": lv, "n_wires": n, "shuffle_cols": cols, "max_jump": jump, + "crossings_total": n_cross["total"], "crossings_on_query_wire": n_cross["query"]}, + "targets": [], "spec": spec} + (d / "certificate.json").write_text(json.dumps(cert, indent=2)) + acc += 1 + stats[lv] = {"n_wires": n, "cols": cols, "jump": jump, "accepted": acc, "rejected": rej, "rejections": reasons} + (out / "wiring_metrics.json").write_text(json.dumps(stats, indent=2)) + log(json.dumps(stats)) + return stats + + +def _n_crossings(spec: dict) -> dict: + cs = curves(spec) + tot = 0 + qn = 0 + for i in range(len(cs)): + for j in range(i + 1, len(cs)): + diff = cs[i][:, 1] - cs[j][:, 1] + c = int((np.sign(diff[:-1]) * np.sign(diff[1:]) < 0).sum()) + tot += c + if spec["query"] in (i, j): + qn += c + return {"total": tot, "query": qn} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..14302a0becce277812f9d921d9411c9d857cf10a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[project] +name = "needlepoint" +version = "0.1.0" +description = "Proof-carrying task factory for instrument-reading visual tasks (Innodata AI Hackathon 2026, Track 2)." +readme = "README.md" +requires-python = ">=3.12" +license = { text = "MIT" } +dependencies = [ + "pillow>=11", + "numpy>=2", + "pydantic>=2.7", + "typer>=0.12", + "jinja2>=3.1", + "matplotlib>=3.9", + "anthropic>=0.70", + "openai>=1.60", + "google-genai>=1.0", + "scipy>=1.13", + "fonttools>=4.50", + "fastapi>=0.115", + "uvicorn>=0.30", +] + +[project.optional-dependencies] +dev = ["pytest>=8", "playwright>=1.45", "axe-playwright-python>=0.1.9", "brotli>=1.1"] + +[project.scripts] +needlepoint = "needlepoint.cli:app" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["needlepoint"] + +[tool.pytest.ini_options] +testpaths = ["tests"] diff --git a/recipes/final-2026-11.json b/recipes/final-2026-11.json new file mode 100644 index 0000000000000000000000000000000000000000..12eaa0cbdccce7d4d50dda90431ccd49e3a09fad --- /dev/null +++ b/recipes/final-2026-11.json @@ -0,0 +1,10 @@ +{ + "name": "needlepoint-final-2026-11", + "description": "Frozen final evaluation set of the Innodata AI Hackathon 2026 submission (commit f90dee2).", + "generator_version": "0.1.0", + "sets": [ + {"name": "instruments", "family": "instruments", "n": 300, "seed": 20261206, "profile": "industrial", "difficulties": [1, 2, 3, 4, 5]}, + {"name": "healthcare", "family": "instruments", "n": 60, "seed": 20261207, "profile": "healthcare", "difficulties": [1, 2, 3]}, + {"name": "wiring", "family": "wiring", "per_level": 16, "seed": 20261208, "levels": [1, 2, 3, 4, 5, 6]} + ] +} diff --git a/recipes/starter-industrial.json b/recipes/starter-industrial.json new file mode 100644 index 0000000000000000000000000000000000000000..d8a79a117ba638fec595781881dfcb02893b5dd2 --- /dev/null +++ b/recipes/starter-industrial.json @@ -0,0 +1,9 @@ +{ + "name": "starter-industrial", + "description": "Small mixed starter set: 120 instrument tasks (difficulty 1-4) + a 6-level wiring ladder (4 per level).", + "generator_version": "0.1.0", + "sets": [ + {"name": "instruments", "family": "instruments", "n": 120, "seed": 1, "profile": "industrial", "difficulties": [1, 2, 3, 4]}, + {"name": "wiring", "family": "wiring", "per_level": 4, "seed": 1, "levels": [1, 2, 3, 4, 5, 6]} + ] +} diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 0000000000000000000000000000000000000000..7ce4d0911f72248145eb1a19a7767b794afa025b --- /dev/null +++ b/requirements.lock @@ -0,0 +1,60 @@ +annotated-doc==0.0.7 +annotated-types==0.8.0 +anthropic==2.14.0 +anyio==4.16.0 +certifi==2026.11.20 +cffi==2.1.1 +charset-normalizer==3.5.3 +click==8.5.1 +contourpy==1.4.0 +cryptography==50.0.2 +cycler==0.12.1 +distro==1.9.0 +docstring-parser==0.18.0 +fastapi==0.165.0 +fonttools==4.69.1 +google-auth==2.63.1 +google-genai==3.6.1 +h11==0.16.0 +httpcore2==2.16.2 +httpx2==2.16.2 +idna==3.20 +iniconfig==2.3.1 +jinja2==3.1.6 +jiter==0.19.0 +kiwisolver==1.5.1 +markdown-it-py==4.3.0 +markupsafe==3.0.4 +matplotlib==3.11.2 +mdurl==0.1.2 +numpy==2.5.5 +openai==3.60.0 +opentelemetry-api==1.45.2 +packaging==26.4 +pillow==13.0.0 +pluggy==1.7.0 +pyasn1==0.6.5 +pyasn1-modules==0.4.2 +pycparser==3.12 +pydantic==2.14.4 +pydantic-core==2.50.5 +pygments==2.21.0 +pyparsing==3.3.3 +pytest==9.2.0 +python-dateutil==4.0.0 +python-multipart==0.0.34 +requests==2.34.2 +rich==15.0.0 +scipy==1.18.1 +shellingham==1.5.4 +sniffio==1.3.1 +starlette==1.10.0 +tenacity==9.1.4 +truststore==0.10.5 +typer==0.29.3 +typing-extensions==4.16.0 +typing-inspection==0.4.5 +tzdata==2026.6 +urllib3==2.8.0 +uvicorn==0.54.0 +websockets==17.4 diff --git a/studio/static/app.js b/studio/static/app.js new file mode 100644 index 0000000000000000000000000000000000000000..c3abe7d54933d6cdb8127dc0dbc04b383f5dab7b --- /dev/null +++ b/studio/static/app.js @@ -0,0 +1,1645 @@ +/* NEEDLEPOINT Studio front end. Vanilla ES module, no dependencies, no external requests. */ + +// ============================================================== utilities +const $ = (sel, root = document) => root.querySelector(sel); +const $$ = (sel, root = document) => Array.from(root.querySelectorAll(sel)); +const SVGNS = "http://www.w3.org/2000/svg"; +const motionQuery = window.matchMedia("(prefers-reduced-motion: reduce)"); +const forceReduce = /[?&]motion=reduce\b/.test(location.search); // handy for testing: /?motion=reduce +const reduced = () => forceReduce || motionQuery.matches; +const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); +const wait = (ms) => (reduced() ? Promise.resolve() : sleep(ms)); +const clamp = (v, a, b) => Math.max(a, Math.min(b, v)); + +/** Create an HTML element. attrs: plain attributes, plus on* handlers, `class`, `style` (string), `html`. */ +function h(tag, attrs = {}, ...kids) { + const el = document.createElement(tag); + setAttrs(el, attrs); + append(el, kids); + return el; +} +/** Create an SVG element. */ +function s(tag, attrs = {}, ...kids) { + const el = document.createElementNS(SVGNS, tag); + setAttrs(el, attrs); + append(el, kids); + return el; +} +function setAttrs(el, attrs) { + for (const [k, v] of Object.entries(attrs || {})) { + if (v === null || v === undefined || v === false) continue; + if (k.startsWith("on") && typeof v === "function") el.addEventListener(k.slice(2), v); + else if (k === "html") el.innerHTML = v; + else if (k === "text") el.textContent = v; + else el.setAttribute(k, v === true ? "" : String(v)); + } +} +function append(el, kids) { + for (const k of kids.flat(Infinity)) { + if (k === null || k === undefined || k === false) continue; + el.append(k instanceof Node ? k : document.createTextNode(String(k))); + } +} +const esc = (t) => String(t).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c])); + +async function api(path, opts = {}) { + const init = { headers: {} }; + if (opts.body !== undefined) { + init.method = "POST"; + init.headers["content-type"] = "application/json"; + init.body = JSON.stringify(opts.body); + } + let res; + try { + res = await fetch(path, init); + } catch (e) { + throw new Error("Cannot reach the local NEEDLEPOINT server. Is `needlepoint serve` running?"); + } + if (!res.ok) { + let msg = `${res.status} ${res.statusText}`; + try { const j = await res.json(); if (j.detail) msg += `: ${typeof j.detail === "string" ? j.detail : JSON.stringify(j.detail)}`; } catch (_) { /* not JSON */ } + throw new Error(msg); + } + return res.json(); +} + +const fmtInt = (n) => Number(n).toLocaleString("en-US"); +const pct = (p, d = 0) => (p === null || p === undefined ? "n/a" : `${(p * 100).toFixed(d)}%`); +function usd(v) { + if (v === 0) return "$0"; + if (Math.abs(v) < 0.1) return `$${v.toFixed(5)}`; + return `$${v.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`; +} +function fmtNum(v, tol) { + if (typeof v !== "number") return String(v); + const d = tol === undefined || tol === null ? 2 : tol >= 1 ? 1 : Math.max(1, Math.ceil(-Math.log10(tol))); + return Number(v.toFixed(Math.min(d, 4))).toString(); +} +const shortHash = (x) => (x ? (x.startsWith("sha256:") ? x.slice(7) : x) : ""); +const trunc = (x, a = 10, b = 6) => (x.length > a + b + 1 ? `${x.slice(0, a)}…${x.slice(-b)}` : x); + +// ------------------------------------------------------------- icons (icon + word, never colour alone) +const ICON = { + check: '', + cross: '', + pending: '', + copy: '', + download: '', + seal: '', + twin: '', +}; +const passFail = (ok) => (ok ? `${ICON.check}Pass` : `${ICON.cross}Fail`); + +// ------------------------------------------------------------- vocabulary +const MODEL_NAMES = { + "gpt-6.2-astra": "GPT-6.2 Astra", "claude-opus-5-5": "Claude Opus 5.5", "gpt-6-luna": "GPT-6 Luna", + "claude-haiku-5-5": "Claude Haiku 5.5", "gemini-3.1-flash-lite": "Gemini 3.1 Flash-Lite", + "claude-sonnet-5-5": "Claude Sonnet 5.5", "gemini-3.1-pro-preview": "Gemini 3.1 Pro (preview)", "gemini-3.8-flash": "Gemini 3.8 Flash", +}; +const MODEL_SHORT = { "gpt-6.2-astra": "Astra", "claude-opus-5-5": "Opus", "gpt-6-luna": "Luna", "claude-haiku-5-5": "Haiku", "gemini-3.1-flash-lite": "Flash-Lite" }; +const mName = (m) => MODEL_NAMES[m] || m; +const mShort = (m) => MODEL_SHORT[m] || mName(m); +const mColor = (m) => `var(--m-${m.replace(/[^a-z0-9]+/gi, "-")}, var(--muted))`; +const swatch = (m, cls = "swatch") => h("span", { class: cls, style: `background:${mColor(m)}`, "aria-hidden": "true" }); + +const GATE_FALLBACK = { W3_legibility: "Label legibility", W4_leak: "No answer leak", G7_twin: "Answer-flip twin" }; +const gateLabel = (id) => (state.meta?.gates || []).find((g) => g.id === id)?.label || GATE_FALLBACK[id] || id.replace(/^[A-Z]\d+_/, "").replace(/_/g, " "); +const gateShort = (id) => id.split("_")[0]; + +const OP_INFO = { + READ: "Read one instrument", THRESH: "Is it in its alarm range?", COMPARE: "Which reading is highest?", + DIFF: "Difference of two readings", COUNT_ALARM: "Count instruments in alarm", SCALE: "Apply the scale multiplier", + BIND: "Bind a tag to its instrument", ABSTAIN: "Indicator hidden: must abstain", TRACE: "Trace a wire through crossings", +}; + +const FAULTS = { + occluded: { name: "Occluded needle", desc: "A cover plate hides the needle. Nobody can read it from the image, so the task must not ship.", + icon: '' }, + illegible: { name: "Illegible labels", desc: "Scale numbers shrunk and faded until they cannot be read reliably.", + icon: '' }, + near_threshold: { name: "Near-threshold reading", desc: "The value sits a hair from the alarm line, so an honest reader could go either way.", + icon: '' }, + wrong_key: { name: "Wrong answer key", desc: "The image says one thing and the answer key says another.", + icon: '' }, + leak: { name: "Answer leaked in question", desc: "The question text gives the answer away, so the image is never needed.", + icon: '' }, + missing_glyph: { name: "Missing glyph", desc: "A character the font cannot draw renders as an empty box (tofu).", + icon: '' }, +}; + +// ------------------------------------------------------------- global state +const state = { + meta: null, runs: [], results: null, models: null, + current: null, // {run_id, tasks, metrics?, seed?, family?, rejections?} + lastGenerated: null, // run_id + proofOn: false, + insp: null, // {run, list, idx, task, proof, opener, pushed} +}; +const loaded = {}; + +// ------------------------------------------------------------- toast, copy, tooltip +let toastTimer; +function toast(msg) { + const t = $("#toast"); + t.textContent = msg; + t.classList.add("show"); + clearTimeout(toastTimer); + toastTimer = setTimeout(() => t.classList.remove("show"), 1800); +} +async function copyText(text, what = "Copied") { + try { + await navigator.clipboard.writeText(text); + } catch (_) { + const ta = h("textarea", { style: "position:fixed;opacity:0" }); + ta.value = text; + document.body.append(ta); + ta.select(); + try { document.execCommand("copy"); } catch (e) { /* ignore */ } + ta.remove(); + } + toast(`${what} copied`); +} +const copyBtn = (text, label) => h("button", { type: "button", class: "icon-btn copy-btn", "aria-label": `Copy ${label}`, title: `Copy ${label}`, html: ICON.copy, onclick: () => copyText(text, label) }); + +const tip = h("div", { class: "tooltip", role: "tooltip", id: "np-tooltip" }); +document.body.append(tip); +function showTip(html, target) { + tip.innerHTML = html; + tip.classList.add("show"); + const r = target.getBoundingClientRect(); + const tw = tip.offsetWidth, th = tip.offsetHeight; + let x = r.left + r.width / 2 - tw / 2; + let y = r.top - th - 10; + if (y < 70) y = r.bottom + 10; + x = clamp(x, 8, window.innerWidth - tw - 8); + tip.style.left = `${x}px`; + tip.style.top = `${y}px`; +} +const hideTip = () => { tip.classList.remove("show"); tip.style.left = "0px"; tip.style.top = "0px"; }; +function bindTip(el, html) { + const show = () => showTip(typeof html === "function" ? html() : html, el); + el.addEventListener("mouseenter", show); + el.addEventListener("mouseleave", hideTip); + el.addEventListener("focus", show); + el.addEventListener("blur", hideTip); +} +window.addEventListener("scroll", hideTip, { passive: true }); + +/** Roving tabindex over a 2-D grid of focusable elements (arrow keys move, one tab stop). */ +function roving(grid) { + const flat = grid.flat().filter(Boolean); + flat.forEach((el, i) => el.setAttribute("tabindex", i === 0 ? "0" : "-1")); + grid.forEach((row, r) => row.forEach((el, c) => { + if (!el) return; + el.addEventListener("keydown", (e) => { + let nr = r, nc = c; + if (e.key === "ArrowRight") nc++; + else if (e.key === "ArrowLeft") nc--; + else if (e.key === "ArrowDown") nr++; + else if (e.key === "ArrowUp") nr--; + else if (e.key === "Home") nc = 0; + else if (e.key === "End") nc = row.length - 1; + else return; + e.preventDefault(); + nr = clamp(nr, 0, grid.length - 1); + nc = clamp(nc, 0, grid[nr].length - 1); + const nxt = grid[nr][nc]; + if (nxt) { + flat.forEach((x) => x.setAttribute("tabindex", "-1")); + nxt.setAttribute("tabindex", "0"); + nxt.focus(); + } + }); + })); +} + +/** Count-up for a number in an element (instant when reduced motion). */ +function countUp(el, to, { dur = 1200, fmt = (v) => fmtInt(Math.round(v)) } = {}) { + if (reduced()) { el.textContent = fmt(to); return; } + const t0 = performance.now(); + const step = (t) => { + const p = clamp((t - t0) / dur, 0, 1); + const e = 1 - Math.pow(1 - p, 4); + el.textContent = fmt(to * e); + if (p < 1) requestAnimationFrame(step); + }; + requestAnimationFrame(step); +} + +// ============================================================== theme +function currentTheme() { return document.documentElement.dataset.theme === "light" ? "light" : "dark"; } +function applyThemeLabel() { + const light = currentTheme() === "light"; + const btn = $("#theme-toggle"); + btn.querySelector(".theme-toggle-label").textContent = light ? "Dark theme" : "Light theme"; + btn.setAttribute("aria-label", light ? "Switch to dark theme" : "Switch to light theme"); + btn.removeAttribute("aria-pressed"); +} +$("#theme-toggle").addEventListener("click", () => { + const next = currentTheme() === "light" ? "dark" : "light"; + document.documentElement.dataset.theme = next; + try { localStorage.setItem("np-theme", next); } catch (_) { /* storage blocked */ } + applyThemeLabel(); + if (state.results && !$("#view-map").hidden) renderMap(false); +}); +applyThemeLabel(); + +// ============================================================== nav & router +const VIEWS = ["home", "factory", "lab", "map", "ship", "how"]; +const TITLES = { home: "NEEDLEPOINT Studio", factory: "Factory", lab: "Verifier Lab", map: "Capability Map", ship: "Ship it", how: "How it works" }; +let currentView = null; +let firstRoute = true; + +const navToggle = $("#nav-toggle"); +const nav = $("#primary-nav"); +navToggle.addEventListener("click", () => { + const open = navToggle.getAttribute("aria-expanded") !== "true"; + navToggle.setAttribute("aria-expanded", String(open)); + nav.classList.toggle("open", open); + if (open) nav.querySelector("a")?.focus(); +}); +function closeNav() { navToggle.setAttribute("aria-expanded", "false"); nav.classList.remove("open"); } +nav.addEventListener("click", (e) => { if (e.target.closest("a")) closeNav(); }); +document.addEventListener("keydown", (e) => { + if (e.key === "Escape" && nav.classList.contains("open")) { closeNav(); navToggle.focus(); } +}); +document.addEventListener("click", (e) => { if (nav.classList.contains("open") && !e.target.closest("#topbar")) closeNav(); }); + +$("#skip-link").addEventListener("click", (e) => { + e.preventDefault(); + const v = currentView && $(`#view-${currentView} h1`); + (v || $("#main")).focus(); +}); + +function parseHash() { + const raw = location.hash.replace(/^#\/?/, ""); + const parts = raw.split("/").filter(Boolean).map(decodeURIComponent); + if (parts[0] === "task" && parts[1] && parts[2]) return { view: "factory", task: { run: parts[1], task: parts[2] } }; + return { view: VIEWS.includes(parts[0]) ? parts[0] : "home" }; +} + +function route() { + if (location.hash && !location.hash.startsWith("#/")) return; // in-page anchors + const r = parseHash(); + showView(r.view); + if (r.task) openInspector(r.task.run, r.task.task); + else if (state.insp) closeInspector({ fromRoute: true }); +} +window.addEventListener("hashchange", route); + +function showView(view) { + if (view === currentView) return; + for (const v of VIEWS) $(`#view-${v}`).hidden = v !== view; + $$(".primary-nav a").forEach((a) => { + if (a.dataset.route === view) a.setAttribute("aria-current", "page"); + else a.removeAttribute("aria-current"); + }); + document.title = view === "home" ? TITLES.home : `${TITLES[view]} · NEEDLEPOINT Studio`; + currentView = view; + if (!firstRoute) { + window.scrollTo({ top: 0, behavior: "instant" }); + $(`#view-${view} h1`)?.focus({ preventScroll: true }); + } + firstRoute = false; + ({ home: initHome, factory: initFactory, lab: initLab, map: initMap, ship: initShip, how: initHow })[view](); +} + +// ============================================================== shared data +let metaP = null; +function getMeta() { + if (!metaP) metaP = api("/api/meta").then((m) => { state.meta = m; $("#footer-version").textContent = `v${m.version}`; return m; }) + .catch((e) => { metaP = null; throw e; }); + return metaP; +} +async function refreshRuns() { + try { state.runs = (await api("/api/runs")).runs || []; } catch (_) { state.runs = []; } + return state.runs; +} + +function errorBox(el, err, retry) { + el.hidden = false; + el.replaceChildren(h("strong", {}, "Something went wrong."), h("span", {}, err.message || String(err)), + retry ? h("button", { type: "button", class: "btn btn-sm btn-ghost", onclick: () => { el.hidden = true; retry(); } }, "Try again") : null); +} + +// ============================================================== HOME +function heroGauge() { + const C = { x: 64, y: 64 }, R = 40; + const a0 = 230.5, a1 = -50.5; // scale spans the logo's dial arc + const pt = (deg, r) => [C.x + r * Math.cos((deg * Math.PI) / 180), C.y - r * Math.sin((deg * Math.PI) / 180)]; + const ticks = []; + for (let i = 0; i <= 50; i++) { + const deg = a0 + ((a1 - a0) * i) / 50; + const major = i % 10 === 0; + const mid = i % 5 === 0; + const [x1, y1] = pt(deg, 45.5); + const [x2, y2] = pt(deg, major ? 50.5 : mid ? 49 : 47.5); + ticks.push(s("line", { x1, y1, x2, y2, class: `hg-tick${major ? " major" : ""}`, "stroke-width": major ? 1.1 : 0.6 })); + if (major) { + const [tx, ty] = pt(deg, 55.5); + ticks.push(s("text", { x: tx, y: ty, class: "hg-num" }, String(i * 2))); + } + } + const svg = s("svg", { viewBox: "-4 -4 136 136", role: "img", "aria-label": "Animated gauge: the needle sweeps across the dial and settles into a check mark, the NEEDLEPOINT logo." }, + s("defs", {}, + s("radialGradient", { id: "hg-face", cx: "50%", cy: "42%", r: "60%" }, + s("stop", { offset: "0", "stop-color": "#1A2A4C" }), s("stop", { offset: "1", "stop-color": "#0B1220" })), + s("radialGradient", { id: "hg-face-light", cx: "50%", cy: "42%", r: "60%" }, + s("stop", { offset: "0", "stop-color": "#22345C" }), s("stop", { offset: "1", "stop-color": "#0F1A30" })), + s("linearGradient", { id: "hg-dial", x1: "0", y1: "1", x2: "1", y2: "0" }, + s("stop", { offset: "0", "stop-color": "#22D3EE" }), s("stop", { offset: "1", "stop-color": "#7C5CFF" })), + s("filter", { id: "hg-glow", x: "-50%", y: "-50%", width: "200%", height: "200%" }, + s("feGaussianBlur", { stdDeviation: "1.6", result: "b" }), + s("feMerge", {}, s("feMergeNode", { in: "b" }), s("feMergeNode", { in: "SourceGraphic" })))), + s("circle", { cx: 64, cy: 64, r: 61, class: "hg-face" }), + s("circle", { cx: 64, cy: 64, r: 61, class: "hg-ring", id: "hg-ring" }), + s("g", { style: "color:#F8FAFC" }, ticks), + s("path", { d: "M35.72,98.28 A40,40 0 1 1 103.39,76.95", fill: "none", stroke: "url(#hg-dial)", "stroke-width": 7, "stroke-linecap": "round", id: "hg-arc" }), + s("path", { d: "M102.04,82.36 A40,40 0 0 1 92.28,98.28", fill: "none", stroke: "#FF4D5E", "stroke-width": 7, "stroke-linecap": "round" }), + s("path", { d: "M46,60 L60,74", fill: "none", stroke: "#F8FAFC", "stroke-width": 8, "stroke-linecap": "round", id: "hg-short", "stroke-dasharray": "20", "stroke-dashoffset": "20" }), + s("g", { id: "hg-needle", style: "transform-box:view-box;transform-origin:60px 74px" }, + s("path", { d: "M60,74 L83.4,44.1", fill: "none", stroke: "#F8FAFC", "stroke-width": 8, "stroke-linecap": "round" }), + s("circle", { cx: 83.4, cy: 44.1, r: 5, fill: "#22D3EE", filter: "url(#hg-glow)" })), + s("text", { x: 64, y: 107, class: "hg-readout", id: "hg-readout", style: "fill:#B6C2D4", opacity: 0 }, "CERTIFIED"), + ); + return svg; +} + +function playHero() { + const wrap = $("#hero-visual"); + if (!wrap.querySelector("svg")) wrap.replaceChildren(heroGauge()); + const needle = $("#hg-needle"), short = $("#hg-short"), ring = $("#hg-ring"), readout = $("#hg-readout"); + needle.getAnimations?.().forEach((a) => a.cancel()); + if (reduced()) { + short.setAttribute("stroke-dashoffset", "0"); + readout.setAttribute("opacity", "1"); + return; + } + short.setAttribute("stroke-dashoffset", "20"); + readout.setAttribute("opacity", "0"); + needle.animate([ + { transform: "rotate(-178deg)", easing: "cubic-bezier(.3,0,.25,1)" }, + { transform: "rotate(24deg)", offset: 0.55, easing: "ease-in-out" }, + { transform: "rotate(-11deg)", offset: 0.72, easing: "ease-in-out" }, + { transform: "rotate(5deg)", offset: 0.85, easing: "ease-in-out" }, + { transform: "rotate(-1.5deg)", offset: 0.94 }, + { transform: "rotate(0deg)" }, + ], { duration: 1900, delay: 250, fill: "backwards" }); + short.animate([{ strokeDashoffset: 20 }, { strokeDashoffset: 0 }], { duration: 320, delay: 2050, easing: "cubic-bezier(.16,1,.3,1)", fill: "forwards" }) + .finished.then(() => short.setAttribute("stroke-dashoffset", "0")).catch(() => {}); + ring.animate([{ opacity: 0.9, strokeWidth: 0.6, transform: "scale(.92)" }, { opacity: 0, strokeWidth: 0.2, transform: "scale(1.06)" }], + { duration: 900, delay: 2250, easing: "ease-out", fill: "none" }); + ring.style.transformBox = "view-box"; ring.style.transformOrigin = "64px 64px"; + readout.animate([{ opacity: 0, transform: "translateY(3px)" }, { opacity: 1, transform: "none" }], { duration: 500, delay: 2350, fill: "forwards", easing: "ease-out" }) + .finished.then(() => readout.setAttribute("opacity", "1")).catch(() => {}); +} + +async function initHome() { + playHero(); + if (loaded.home) return; + loaded.home = true; + const ul = $("#home-stats"); + try { + const m = await getMeta(); + const ev = m.evidence || {}; + const recalls = Object.values(ev.fault_recall || {}); + const recall = recalls.length ? recalls.reduce((a, b) => a + b, 0) / recalls.length : null; + const [hOk, hN] = String(ev.harbor_checks || "0/0").split("/").map(Number); + const stats = [ + { to: ev.final_tasks || 0, fmt: (v) => fmtInt(Math.round(v)), label: "certified tasks in the final evaluation" }, + { to: recall === null ? 0 : recall * 100, fmt: (v) => `${Math.round(v)}%`, label: `planted-defect recall across ${recalls.length} defect classes` }, + { to: hOk, fmt: (v) => `${Math.round(v)}/${hN}`, label: "Harbor validation checks passed" }, + { to: 0, fmt: () => "$0", label: "API cost to generate a task" }, + ]; + ul.replaceChildren(...stats.map((st) => { + const num = h("span", { class: "stat-num", "aria-hidden": "true" }, st.fmt(0)); + const li = h("li", { class: "stat" }, num, h("span", { class: "sr-only" }, `${st.fmt(st.to)} `), h("span", { class: "stat-label" }, st.label)); + countUp(num, st.to, { fmt: st.fmt, dur: 1400 }); + return li; + })); + } catch (e) { + loaded.home = false; + ul.replaceChildren(h("li", { class: "stat" }, h("span", { class: "stat-label" }, `Could not load evidence: ${e.message}`))); + } +} + +// ============================================================== FACTORY +const PIPE_STAGES = [ + { name: "Spec", icon: '' }, + { name: "Render", icon: '' }, + { name: "Question program", icon: '' }, + { name: "Gates", icon: '' }, + { name: "Certified", icon: '' }, +]; + +const fx = { family: "instruments", diffs: { instruments: new Set([1, 2, 3]), wiring: new Set([1, 2, 3]) } }; + +async function initFactory() { + if (loaded.factory) return; + loaded.factory = true; + renderGridSkeleton(); + try { + await getMeta(); + } catch (e) { + loaded.factory = false; + errorBox($("#factory-error"), e, initFactory); + $("#task-grid").replaceChildren(); + return; + } + renderDiffChips(); + bindFactoryForm(); + await populateRunSelect(); + const r = parseHash(); + const want = r.task ? r.task.run : state.lastGenerated || "final-instruments"; + if (!state.current || state.current.run_id !== want) await loadRun(want); +} + +function renderGridSkeleton(n = 8) { + $("#task-grid").replaceChildren(...Array.from({ length: n }, (_, i) => h("li", { class: "task-card", style: `--i:${i}`, "aria-hidden": "true" }, + h("div", { class: "task-btn" }, h("div", { class: "task-thumb" }, h("span", { class: "skeleton" })), + h("div", { class: "task-info" }, h("span", { class: "skeleton sk-line", style: "width:40%" }), h("span", { class: "skeleton sk-line" }), h("span", { class: "skeleton sk-line", style: "width:70%" })))))); +} + +function renderDiffChips() { + const fam = state.meta.families[fx.family]; + const box = $("#diff-chips"); + box.replaceChildren(...fam.difficulties.map((d) => { + const on = fx.diffs[fx.family].has(d); + return h("button", { + type: "button", class: "chip-toggle", "aria-pressed": String(on), title: `Difficulty ${d}`, + onclick: (e) => { + const set = fx.diffs[fx.family]; + if (set.has(d) && set.size === 1) { toast("Keep at least one difficulty"); return; } + set.has(d) ? set.delete(d) : set.add(d); + e.currentTarget.setAttribute("aria-pressed", String(set.has(d))); + }, + }, h("svg", { class: "tick", viewBox: "0 0 12 12", "aria-hidden": "true", html: '' }), h("span", { class: "sr-only" }, "Difficulty "), `D${d}`); + })); + $("#profile-ctl").hidden = fx.family !== "instruments"; + $("#count-label").textContent = fx.family === "wiring" ? "Tasks per level" : "Tasks"; +} + +function bindFactoryForm() { + const form = $("#gen-form"); + form.addEventListener("change", (e) => { + if (e.target.name === "family") { + fx.family = e.target.value; + $("#count").value = fx.family === "wiring" ? 2 : 8; + renderDiffChips(); + } + }); + $("#dice-btn").addEventListener("click", (e) => { + $("#seed").value = Math.floor(Math.random() * 1e6); + const b = e.currentTarget; + b.classList.remove("rolling"); void b.offsetWidth; b.classList.add("rolling"); + toast(`Seed set to ${$("#seed").value}`); + }); + $("#seed-copy").addEventListener("click", () => { + const v = $("#seed").value || state.current?.seed; + if (v === undefined || v === null || v === "") { toast("No seed yet: roll one or generate"); return; } + copyText(String(v), `Seed ${v}`); + }); + form.addEventListener("submit", (e) => { e.preventDefault(); generate(); }); + $("#run-select").addEventListener("change", (e) => loadRun(e.target.value)); +} + +async function populateRunSelect() { + await refreshRuns(); + const sel = $("#run-select"); + const opts = [h("option", { value: "final-instruments" }, "Frozen evidence set · final-instruments")]; + for (const r of state.runs) opts.push(h("option", { value: r.run_id }, `${r.run_id} · ${r.n_tasks} task${r.n_tasks === 1 ? "" : "s"}`)); + sel.replaceChildren(...opts); + if (state.current) sel.value = state.current.run_id; + populateExportSelect(); +} + +async function loadRun(runId) { + $("#factory-error").hidden = true; + $("#funnel").hidden = true; + $("#pipeline").hidden = true; + renderGridSkeleton(6); + try { + const r = await api(`/api/runs/${encodeURIComponent(runId)}`); + const seedMatch = /^[a-z]+-(\d+)-/.exec(runId); + state.current = { run_id: runId, tasks: r.tasks, seed: seedMatch ? Number(seedMatch[1]) : null }; + $("#run-select").value = runId; + renderRunMeta(); + renderGrid(); + } catch (e) { + errorBox($("#factory-error"), e, () => loadRun(runId)); + $("#task-grid").replaceChildren(); + } +} + +const visibleTasks = () => (state.current?.tasks || []).filter((t) => t.has_image); + +function renderRunMeta() { + const c = state.current; + const box = $("#run-meta"); + const shown = visibleTasks().length, total = c.tasks.length; + const pills = [h("span", { class: "pill" }, "Run ", h("span", { class: "mono" }, c.run_id), copyBtn(c.run_id, "run id"))]; + if (c.seed !== null && c.seed !== undefined) pills.push(h("span", { class: "pill" }, "Seed ", h("span", { class: "mono" }, String(c.seed)), copyBtn(String(c.seed), `Seed ${c.seed}`))); + pills.push(h("span", { class: "pill" }, h("span", { class: "mono" }, String(shown)), shown === total ? " certified tasks" : ` of ${total} tasks have stored images`)); + if (c.run_id === "final-instruments") pills.push(h("span", { class: "hint" }, "The rest regenerate byte-identically from their seeds.")); + else if (c.seed !== null) pills.push(h("span", { class: "hint" }, "Same seed and settings reproduce byte-identical images.")); + box.replaceChildren(...pills); +} + +function renderGrid() { + const grid = $("#task-grid"); + const tasks = visibleTasks(); + if (!tasks.length) { + grid.replaceChildren(h("li", { class: "empty" }, "No tasks with images in this run. Generate a batch above.")); + return; + } + grid.replaceChildren(...tasks.map((t, i) => { + const thumb = h("div", { class: "task-thumb" }, h("span", { class: "skeleton" })); + const img = h("img", { src: t.image_url, alt: t.alt, loading: "lazy", decoding: "async", width: 1024, height: 768 }); + img.addEventListener("load", () => { img.classList.add("loaded"); thumb.querySelector(".skeleton")?.remove(); }); + img.addEventListener("error", () => thumb.querySelector(".skeleton")?.classList.remove("skeleton")); + thumb.prepend(img); + const btn = h("button", { + type: "button", class: "task-btn", "data-task": t.task_id, + onclick: () => { location.hash = `#/task/${encodeURIComponent(t.run_id)}/${encodeURIComponent(t.task_id)}`; }, + }, thumb, h("div", { class: "task-info" }, + h("div", { class: "task-tags" }, h("span", { class: "op-badge" }, t.op), h("span", { class: "sr-only" }, " task. "), diffPips(t.difficulty, t.family), + t.twin_id ? h("span", { class: "twin-badge", html: `${ICON.twin} twin` }) : null), + h("p", { class: "task-q" }, t.question), + h("span", { class: "cert-mark", html: `${ICON.check.replace('class="vi"', 'class="vi" style="width:14px;height:14px"')} Certified` }))); + return h("li", { class: "task-card", style: `--i:${Math.min(i, 24)}` }, btn); + })); +} + +function diffPips(d, family) { + const max = family === "wiring" ? 6 : 5; + return h("span", { class: "diff", title: `Difficulty ${d} of ${max}` }, h("span", { class: "sr-only" }, `Difficulty ${d} of ${max}`), + h("span", { "aria-hidden": "true", style: "display:inline-flex;gap:2px" }, Array.from({ length: max }, (_, i) => h("i", { class: i < d ? "on" : "" }))), + h("span", { "aria-hidden": "true" }, ` D${d}`)); +} + +// --- pipeline animation +function pipelineRunner(family) { + const pipe = $("#pipeline"); + const stages = $("#pipe-stages"), lamps = $("#gate-lamps"); + const gates = (state.meta.gates || []).filter((g) => (family === "wiring" ? g.id.startsWith("W") : g.id.startsWith("G"))); + stages.replaceChildren(...PIPE_STAGES.map((st) => h("li", { class: "pipe-stage" }, h("span", { class: "pipe-node", html: st.icon }), st.name))); + lamps.replaceChildren(...gates.map((g) => h("li", { class: "gate-lamp" }, h("span", { class: "lamp", "aria-hidden": "true" }), h("span", { class: "gid" }, gateShort(g.id)), g.label))); + pipe.hidden = false; + const stEls = $$(".pipe-stage", stages), lampEls = $$(".gate-lamp", lamps); + let stopped = false; + const setStage = (i) => stEls.forEach((el, k) => { el.classList.toggle("done", k < i); el.classList.toggle("active", k === i); }); + const loop = (async () => { + if (reduced()) { setStage(3); return; } + for (let i = 0; i < 3 && !stopped; i++) { setStage(i); await sleep(380); } + setStage(3); + while (!stopped) { + for (let k = 0; k < lampEls.length && !stopped; k++) { + lampEls[k].classList.add("checking"); + await sleep(150); + lampEls[k].classList.remove("checking"); + lampEls[k].classList.add("lit"); + } + if (stopped) break; + await sleep(260); + if (!stopped) lampEls.forEach((l) => l.classList.remove("lit")); + } + })(); + return { + async finish(ok) { + stopped = true; + await loop; + lampEls.forEach((l) => { l.classList.remove("checking"); if (ok) l.classList.add("lit"); }); + if (ok) { + setStage(4); + await wait(380); + stEls.forEach((el) => { el.classList.remove("active"); el.classList.add("done"); }); + } else { + pipe.hidden = true; + } + }, + }; +} + +let generating = false; +async function generate() { + if (generating) return; + const fam = fx.family; + const famMeta = state.meta.families[fam]; + let n = parseInt($("#count").value, 10); + if (!Number.isFinite(n)) n = fam === "wiring" ? 2 : 8; + n = clamp(n, 1, 48); + $("#count").value = n; + const seedRaw = $("#seed").value.trim(); + const seed = seedRaw === "" ? null : clamp(parseInt(seedRaw, 10) || 0, 0, 999999999); + const difficulty = [...fx.diffs[fam]].filter((d) => famMeta.difficulties.includes(d)).sort((a, b) => a - b); + // the API takes n as total for instruments, per level for wiring (it divides n by #levels) + const body = { family: fam, n: fam === "wiring" ? clamp(n * difficulty.length, 1, 48) : n, seed, difficulty, profile: $("#profile").value }; + const btn = $("#gen-btn"); + const status = $("#gen-status"); + generating = true; + btn.disabled = true; + btn.setAttribute("aria-busy", "true"); + $("#factory-error").hidden = true; + $("#funnel").hidden = true; + status.textContent = `Generating ${fam} tasks${seed !== null ? ` with seed ${seed}` : ""}. Running every candidate through the gates.`; + const runner = pipelineRunner(fam); + renderGridSkeleton(Math.min(8, n)); + const t0 = performance.now(); + try { + const [res] = await Promise.all([api("/api/generate", { body }), wait(1700)]); + await runner.finish(true); + state.lastGenerated = res.run_id; + state.current = { run_id: res.run_id, tasks: res.tasks, metrics: res.metrics, seed: res.seed, family: res.family, rejections: res.rejections }; + $("#seed").value = res.seed; + await populateRunSelect(); + $("#run-select").value = res.run_id; + renderRunMeta(); + renderFunnel(); + renderGrid(); + const m = res.metrics; + status.textContent = `Done. ${m.accepted} certified task${m.accepted === 1 ? "" : "s"} in ${m.seconds} seconds. Seed ${res.seed}.`; + } catch (e) { + await runner.finish(false); + errorBox($("#factory-error"), e, generate); + status.textContent = `Generation failed: ${e.message}`; + if (state.current) renderGrid(); else $("#task-grid").replaceChildren(); + } finally { + generating = false; + btn.disabled = false; + btn.removeAttribute("aria-busy"); + void t0; + } +} + +function renderFunnel() { + const c = state.current, m = c.metrics; + const f = $("#funnel"); + if (!m) { f.hidden = true; return; } + const rej = Object.entries(m.rejections_by_gate || {}).sort((a, b) => b[1] - a[1]); + const maxRej = Math.max(1, ...rej.map((r) => r[1])); + // The instruments factory counts answer-flip twins as accepted tasks but not as candidates; add them back. + const ids = new Set(c.tasks.map((t) => t.task_id)); + const twins = c.family === "wiring" ? 0 : Math.floor(c.tasks.filter((t) => t.twin_id && ids.has(t.twin_id)).length / 2); + const cand = Math.max(m.accepted, m.candidates + twins); + const rejected = cand - m.accepted; + const left = h("div", {}, + h("h2", {}, "Certification funnel"), + h("p", { class: "funnel-big" }, String(m.accepted), h("small", {}, ` / ${cand} candidates certified`)), + h("div", { class: "funnel-bar", role: "img", "aria-label": `${m.accepted} of ${cand} candidates certified` }, + h("span", { style: `width:${(100 * m.accepted) / Math.max(1, cand)}%` })), + h("p", { class: "hint" }, `${rejected} rejected${twins ? ` · ${twins} answer-flip twin${twins === 1 ? "" : "s"} included` : ""} · ${m.seconds} s · seed ${c.seed}`)); + const right = h("div", {}, h("h2", {}, "Rejections by gate")); + if (!rej.length) right.append(h("p", { class: "muted" }, "No candidate was rejected in this batch.")); + else { + right.append(h("ul", { class: "rej-list" }, rej.map(([g, n], i) => h("li", { class: "rej-row" }, + h("span", { class: "rej-label", title: gateLabel(g) }, h("span", { class: "mono" }, gateShort(g)), ` ${gateLabel(g)}`), + h("span", { class: "rej-track", "aria-hidden": "true" }, h("span", { style: `width:${(100 * n) / maxRej}%;animation-delay:${i * 80}ms` })), + h("span", { class: "mono" }, String(n)))))); + } + if (c.rejections?.length) { + right.append(h("details", { class: "rej-log" }, h("summary", {}, `Rejection log (${c.rejections.length})`), + h("ul", {}, c.rejections.slice(0, 12).map((r) => h("li", {}, h("span", { class: "mono" }, `seed ${r.seed} · ${r.op}`), " failed ", + r.failed.map((g) => `${gateShort(g)} (${gateLabel(g)})`).join(", "), ": ", Object.values(r.detail || {}).join("; ")))))); + } + f.replaceChildren(left, right); + f.hidden = false; +} + +// ============================================================== INSPECTOR +const drawer = $("#inspector"), backdrop = $("#drawer-backdrop"); +let inspToken = 0; + +async function openInspector(runId, taskId) { + const wasOpen = !!state.insp; + if (!wasOpen) { + state.insp = { opener: document.activeElement, run: runId }; + drawer.hidden = false; + backdrop.hidden = false; + drawer.classList.remove("closing"); + document.body.style.overflow = "hidden"; + $("#main").setAttribute("inert", ""); + $("#topbar").setAttribute("inert", ""); + } + const ins = state.insp; + ins.run = runId; + // make sure we have the run's task list for prev/next + if (!state.current || state.current.run_id !== runId) { + try { + const r = await api(`/api/runs/${encodeURIComponent(runId)}`); + state.current = { run_id: runId, tasks: r.tasks, seed: (/^[a-z]+-(\d+)-/.exec(runId) || [])[1] ?? null }; + if (loaded.factory) { $("#run-select").value = runId; $("#funnel").hidden = true; $("#pipeline").hidden = true; renderRunMeta(); renderGrid(); } + } catch (e) { + $("#insp-body").replaceChildren(h("div", { class: "error-box", role: "alert" }, h("strong", {}, "Could not open this run. "), e.message)); + return; + } + } + ins.list = visibleTasks(); + ins.idx = ins.list.findIndex((t) => t.task_id === taskId); + if (!wasOpen) $("#insp-title").focus(); + await renderInspector(taskId); +} + +function closeInspector({ fromRoute = false } = {}) { + if (!state.insp) return; + const opener = state.insp.opener; + const taskId = state.insp.task?.task_id; + state.insp = null; + hideTip(); + const done = () => { + drawer.hidden = true; + backdrop.hidden = true; + drawer.classList.remove("closing"); + }; + if (reduced()) done(); + else { drawer.classList.add("closing"); setTimeout(done, 190); } + document.body.style.overflow = ""; + $("#main").removeAttribute("inert"); + $("#topbar").removeAttribute("inert"); + if (!fromRoute) { + history.pushState(null, "", "#/factory"); + route(); + } + const card = taskId && document.querySelector(`.task-btn[data-task="${CSS.escape(taskId)}"]`); + (card || (opener && document.contains(opener) ? opener : null) || $("#factory-title")).focus({ preventScroll: false }); +} + +function stepInspector(delta) { + const ins = state.insp; + if (!ins || !ins.list.length) return; + const idx = ins.idx < 0 ? 0 : (ins.idx + delta + ins.list.length) % ins.list.length; + const t = ins.list[idx]; + history.replaceState(null, "", `#/task/${encodeURIComponent(t.run_id)}/${encodeURIComponent(t.task_id)}`); + ins.idx = idx; + renderInspector(t.task_id); +} + +$("#insp-close").addEventListener("click", () => closeInspector()); +$("#insp-prev").addEventListener("click", () => stepInspector(-1)); +$("#insp-next").addEventListener("click", () => stepInspector(1)); +backdrop.addEventListener("click", () => closeInspector()); +drawer.addEventListener("keydown", (e) => { + const tag = (e.target.tagName || "").toLowerCase(); + const typing = tag === "input" || tag === "select" || tag === "textarea"; + if (e.key === "Escape") { e.preventDefault(); closeInspector(); return; } + if (e.key === "Tab") { trapFocus(e); return; } + if (typing || e.metaKey || e.ctrlKey || e.altKey) return; + if (e.key === "ArrowLeft") { e.preventDefault(); stepInspector(-1); } + else if (e.key === "ArrowRight") { e.preventDefault(); stepInspector(1); } + else if (e.key === "p" || e.key === "P") { e.preventDefault(); toggleProof(); } +}); +function trapFocus(e) { + const f = $$('a[href], button:not([disabled]), input, select, [tabindex]:not([tabindex="-1"])', drawer).filter((el) => el.offsetParent !== null); + if (!f.length) return; + const first = f[0], last = f[f.length - 1]; + if (e.shiftKey && (document.activeElement === first || !drawer.contains(document.activeElement))) { e.preventDefault(); last.focus(); } + else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); } +} + +async function renderInspector(taskId) { + const token = ++inspToken; + const ins = state.insp; + const run = ins.run; + const summary = ins.list.find((t) => t.task_id === taskId); + $("#insp-title").textContent = taskId; + $("#insp-eyebrow").textContent = summary ? `${run} · ${summary.op} · difficulty ${summary.difficulty}` : run; + $("#insp-pos").textContent = ins.idx >= 0 ? `${ins.idx + 1} / ${ins.list.length}` : ""; + $("#insp-prev").disabled = $("#insp-next").disabled = ins.list.length < 2; + const body = $("#insp-body"); + body.replaceChildren(h("div", { class: "insp-grid" }, + h("div", { class: "insp-main" }, h("div", { class: "card figure-card" }, h("span", { class: "skeleton sk-img" }))), + h("div", { class: "insp-side" }, h("div", { class: "card" }, h("span", { class: "skeleton sk-title" }), h("span", { class: "skeleton sk-line" }), h("span", { class: "skeleton sk-line", style: "margin-top:8px;width:60%" }))))); + body.scrollTop = 0; + const base = `/api/tasks/${encodeURIComponent(run)}/${encodeURIComponent(taskId)}`; + let task, proof; + try { + [task, proof] = await Promise.all([api(base), api(`${base}/proof`).catch((e) => ({ error: e.message }))]); + } catch (e) { + if (token !== inspToken) return; + body.replaceChildren(h("div", { class: "error-box", role: "alert" }, h("strong", {}, "Could not load this task. "), e.message, + h("button", { type: "button", class: "btn btn-sm btn-ghost", onclick: () => renderInspector(taskId) }, "Try again"))); + return; + } + if (token !== inspToken || !state.insp) return; + ins.task = task; + ins.proof = proof; + $("#insp-eyebrow").textContent = `${run} · ${task.op} · difficulty ${task.difficulty}`; + + // --- figure with proof overlay + const img = h("img", { src: task.image_url, alt: task.alt, width: 1024, height: 768 }); + const stage = h("div", { class: "proof-stage" }, img); + const proofBtn = h("button", { type: "button", class: "switch", id: "proof-toggle", "aria-pressed": String(state.proofOn), onclick: toggleProof }, + h("span", { class: "switch-track", "aria-hidden": "true" }, h("span", { class: "switch-thumb" })), "Show proof ", h("kbd", { "aria-hidden": "true" }, "P")); + const verdicts = h("div", { class: "verdicts", id: "verdicts", "aria-live": "polite" }); + const fig = h("div", { class: "card figure-card" }, + h("div", { class: "figure-toolbar" }, proofBtn, + h("p", { class: "hint" }, task.family === "wiring" ? "Proof: the image-only tracer's path" : "Proof: what the image-only decoder read")), + stage, verdicts); + + // --- question + reveal + const ansSlot = h("div", { class: "answer-box" }); + const revealBtn = h("button", { type: "button", class: "btn btn-ghost", onclick: async () => { + revealBtn.disabled = true; + revealBtn.textContent = "Revealing…"; + try { + const r = await api(`${base}?reveal=true`); + revealBtn.remove(); + ansSlot.append(h("span", { class: "answer-val" }, formatAnswer(r.answer)), h("span", { class: "hint" }, `answer type: ${r.answer.answer_type}`)); + ansSlot.setAttribute("aria-live", "polite"); + } catch (e) { + revealBtn.disabled = false; + revealBtn.textContent = "Reveal answer"; + toast(`Could not reveal: ${e.message}`); + } + } }, "Reveal answer"); + ansSlot.append(revealBtn); + const qCard = h("div", { class: "card q-card" }, + h("h3", {}, `Question · ${task.op}`), + h("p", { class: "q-text" }, task.question), + h("p", { class: "hint", style: "margin:-6px 0 12px" }, OP_INFO[task.op] || ""), + ansSlot); + + // --- certificate + const cert = task.certificate || {}; + const gateEntries = Object.entries(cert.gates || {}); + const allPass = gateEntries.every(([, g]) => g.pass); + const sig = cert.variation_signature || {}; + const certCard = h("div", { class: "card cert-card" }, + h("h3", { html: `${ICON.seal} Certificate ${allPass ? "· all gates passed" : "· gate failures"}` }), + h("p", { class: "sub-h" }, "Gate checklist"), + h("ul", { class: "gate-list" }, gateEntries.map(([id, g]) => gateRow(id, g))), + h("p", { class: "sub-h" }, "Provenance"), + h("dl", { class: "kv" }, + h("dt", {}, "Generator"), h("dd", {}, h("span", {}, `v${cert.generator?.version ?? "?"} · seed ${cert.generator?.seed ?? "?"}`), copyBtn(String(cert.generator?.seed ?? ""), "generator seed")), + h("dt", {}, "Image SHA-256"), h("dd", {}, h("span", { title: cert.image_sha256 }, trunc(cert.image_sha256 || "")), copyBtn(cert.image_sha256 || "", "image SHA-256")), + h("dt", {}, "Spec hash"), h("dd", {}, h("span", { title: cert.spec_hash }, trunc(shortHash(cert.spec_hash))), copyBtn(shortHash(cert.spec_hash), "spec hash")), + cert.tracer_full_agreement !== null && cert.tracer_full_agreement !== undefined + ? [h("dt", {}, "Tracer, all wires"), h("dd", { html: cert.tracer_full_agreement ? `${ICON.check}agrees on every wire` : `${ICON.cross}partial` })] : null), + h("details", { class: "rej-log trace-details" }, h("summary", {}, "Reasoning trace (shows the answer)"), + h("ol", { class: "trace-list" }, (cert.trace || []).map((t) => h("li", {}, t)))), + h("p", { class: "sub-h" }, "Variation signature"), + h("div", { class: "sig-chips" }, Object.entries(sig).map(([k, v]) => h("span", { class: "sig-chip" }, `${k}: `, h("b", {}, Array.isArray(v) ? v.join(", ") : String(v)))))); + + const side = h("div", { class: "insp-side" }, qCard, certCard); + const main = h("div", { class: "insp-main" }, fig); + + // --- twin compare + if (task.twin_id) main.append(twinCard(task, run)); + + body.replaceChildren(h("div", { class: "insp-grid" }, main, side)); + renderProof(); + // pre-load neighbours for snappy navigation + [-1, 1].forEach((d) => { const n = ins.list[(ins.idx + d + ins.list.length) % ins.list.length]; if (n) { const p = new Image(); p.src = n.image_url; } }); +} + +function gateRow(id, g) { + return h("li", { class: `gate-row ${g.pass ? "pass" : "fail"}`, html: + `${g.pass ? ICON.check : ICON.cross}${esc(gateShort(id))}${esc(gateLabel(id))}${g.pass ? "Pass" : "Fail"}${esc(g.detail || "")}` }); +} + +function formatAnswer(a) { + if (!a) return ""; + if (a.answer_type === "number") return `${fmtNum(a.answer, a.tolerance)}${a.unit ? ` ${a.unit}` : ""}${a.tolerance ? ` ± ${fmtNum(a.tolerance)}` : ""}`; + if (a.answer_type === "int" && a.tolerance) return `${a.answer} ± ${a.tolerance}`; + return String(a.answer); +} + +function twinCard(task, run) { + const twinSummary = state.current?.tasks.find((t) => t.task_id === task.twin_id); + const card = h("div", { class: "card twin-card" }, h("h3", {}, "Answer-flip twin")); + if (twinSummary && !twinSummary.has_image) { + card.append(h("p", { class: "twin-cap" }, `Twin ${task.twin_id} exists, but its image is not stored in this evidence set (it regenerates from its seed).`)); + return card; + } + const twinUrl = `/api/tasks/${encodeURIComponent(run)}/${encodeURIComponent(task.twin_id)}/image.png`; + const stage = h("div", { class: "twin-stage" }, + h("img", { src: task.image_url, alt: `This task: ${task.alt}` }), + h("img", { class: "twin-top", src: twinUrl, alt: `Twin task ${task.twin_id}`, onerror: () => { card.replaceChildren(h("h3", {}, "Answer-flip twin"), h("p", { class: "twin-cap" }, "The twin image is not available.")); } }), + h("div", { class: "twin-divider", "aria-hidden": "true" }), + h("div", { class: "twin-labels", "aria-hidden": "true" }, h("span", {}, "This task"), h("span", {}, "Twin"))); + const range = h("input", { type: "range", class: "twin-range", min: 0, max: 100, value: 50, "aria-label": "Wipe between this task and its twin", "aria-valuetext": "Split at 50 percent" }); + range.addEventListener("input", () => { + stage.style.setProperty("--wipe", `${range.value}%`); + range.setAttribute("aria-valuetext", `Split at ${range.value} percent: left shows this task, right shows the twin`); + }); + card.append(stage, range, + h("p", { class: "twin-cap" }, "Answer-flip twin: one minimal edit, the answer must change. ", + h("a", { href: `#/task/${encodeURIComponent(run)}/${encodeURIComponent(task.twin_id)}`, onclick: (e) => { + e.preventDefault(); + const i = state.insp.list.findIndex((t) => t.task_id === task.twin_id); + history.replaceState(null, "", `#/task/${encodeURIComponent(run)}/${encodeURIComponent(task.twin_id)}`); + state.insp.idx = i; + renderInspector(task.twin_id); + } }, "Open the twin"))); + return card; +} + +function toggleProof() { + state.proofOn = !state.proofOn; + const b = $("#proof-toggle"); + if (b) b.setAttribute("aria-pressed", String(state.proofOn)); + renderProof(); +} + +function renderProof() { + const ins = state.insp; + if (!ins || !ins.proof) return; + const stage = $(".proof-stage", drawer); + const vbox = $("#verdicts"); + stage?.querySelector(".proof-svg")?.remove(); + if (!state.proofOn) { + vbox.replaceChildren(h("p", { class: "proof-off-note" }, "Turn on the proof to overlay what the image-only checker read from the pixels, and whether it agrees with the spec.")); + return; + } + const p = ins.proof; + if (p.error) { vbox.replaceChildren(h("p", { class: "proof-off-note" }, `Proof unavailable: ${p.error}`)); return; } + stage.append(buildProofSvg(p)); + vbox.replaceChildren(...(p.verdicts || []).map((v, i) => verdictChip(v, ins.task, i))); +} + +function buildProofSvg(p) { + const svg = s("svg", { class: "proof-svg", viewBox: `0 0 ${p.width} ${p.height}`, preserveAspectRatio: "xMidYMid meet", "aria-hidden": "true" }); + const by = (role) => p.shapes.filter((x) => x.role === role); + const anim = (el, d) => { el.classList.add("pf-anim"); el.style.setProperty("--d", `${d}ms`); return el; }; + const draw = (el, len, d, dur) => { + el.style.strokeDasharray = `${len} ${len}`; + el.style.strokeDashoffset = String(len); + el.classList.add("pf-draw"); + el.style.setProperty("--d", `${d}ms`); + el.style.setProperty("--dur", `${dur}ms`); + return el; + }; + by("target").forEach((r) => { + svg.append(anim(s("rect", { x: r.x, y: r.y, width: r.w, height: r.h, rx: 10, class: "pf-target" }), 0)); + if (r.label) { + const w = r.label.length * 9.6 + 16; + svg.append(anim(s("g", { class: "pf-target-label" }, s("rect", { x: r.x, y: Math.max(0, r.y - 26), width: w, height: 24, rx: 6 }), + s("text", { x: r.x + 8, y: Math.max(0, r.y - 26) + 17 }, r.label)), 80)); + } + }); + by("face").forEach((f) => { + if (f.type === "circle") { + const c = s("circle", { cx: f.cx, cy: f.cy, r: f.r, class: "pf-face", transform: `rotate(-90 ${f.cx} ${f.cy})` }); + svg.append(draw(c, 2 * Math.PI * f.r, 150, 700)); + } else svg.append(anim(s("rect", { x: f.x, y: f.y, width: f.w, height: f.h, rx: 4, class: "pf-face" }), 150)); + }); + by("tick").forEach((t, i) => svg.append(anim(s("circle", { cx: t.cx, cy: t.cy, r: 5, class: "pf-tick pf-anim-dot" }), 420 + i * 45))); + by("ocr").forEach((o, i) => { + const d = 650 + i * 60; + svg.append(anim(s("rect", { x: o.x - 3, y: o.y - 3, width: o.w + 6, height: o.h + 6, rx: 3, class: "pf-ocr" }), d)); + if (o.label) svg.append(anim(s("text", { x: o.x + o.w / 2, y: o.y - 7, "text-anchor": "middle", class: "pf-ocr-text" }, o.label), d + 40)); + }); + const tEnd = 650 + by("ocr").length * 60; + by("needle").forEach((n) => { + const len = Math.hypot(n.x2 - n.x1, n.y2 - n.y1); + svg.append(draw(s("line", { x1: n.x1, y1: n.y1, x2: n.x2, y2: n.y2, class: "pf-needle" }), len, Math.max(900, tEnd), 800)); + }); + by("trace").forEach((t) => { + const pts = t.points; + let len = 0; + for (let i = 1; i < pts.length; i++) len += Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]); + svg.append(draw(s("polyline", { points: pts.map((q) => q.join(",")).join(" "), class: "pf-trace" }), len, 200, 1600)); + const a = pts[0], z = pts[pts.length - 1]; + svg.append(anim(s("circle", { cx: a[0], cy: a[1], r: 9, class: "pf-trace-head pf-anim-dot" }), 100)); + svg.append(anim(s("circle", { cx: z[0], cy: z[1], r: 11, class: "pf-trace-head pf-anim-dot" }), 1800)); + }); + return svg; +} + +function verdictChip(v, task, i) { + const ok = !!v.agree; + let text; + if (task.family === "wiring") { + text = v.decoded === null + ? `Tracer could not follow ${v.target}${v.note ? ` (${v.note})` : ""} · spec ${v.expected}` + : `Tracer followed ${v.target} → ${v.decoded} · spec ${v.expected}`; + } else if (v.decoded === null || v.decoded === undefined) { + text = `${v.target}: decoder found no readable indicator${v.note && v.note !== "ok" ? ` (${v.note.replace(/_/g, " ")})` : ""} · spec: ${typeof v.expected === "number" ? fmtNum(v.expected) : v.expected}`; + } else { + const unit = v.unit ? ` ${v.unit}` : ""; + text = `${v.target}: decoder read ${fmtNum(v.decoded, v.tolerance)}${unit} · spec ${fmtNum(v.expected, v.tolerance)}${v.tolerance ? ` ± ${fmtNum(v.tolerance)}` : ""}${unit}`; + if (v.alarm_decoded !== undefined && v.alarm_decoded !== null) text += ` · alarm: read ${v.alarm_decoded ? "yes" : "no"}, spec ${v.alarm_expected ? "yes" : "no"}`; + } + return h("div", { class: `verdict ${ok ? "ok" : "bad"}`, style: `animation-delay:${reduced() ? 0 : 900 + i * 120}ms`, html: + `${ok ? ICON.check : ICON.cross}${esc(text)} · ${ok ? "agrees" : "disagrees"}` }); +} + +// ============================================================== VERIFIER LAB +async function initLab() { + if (loaded.lab) return; + loaded.lab = true; + let m; + try { m = await getMeta(); } catch (e) { loaded.lab = false; errorBox($("#lab-error"), e, initLab); return; } + const grid = $("#fault-grid"); + grid.replaceChildren(...m.fault_kinds.map((f, i) => { + const info = FAULTS[f.kind] || { name: f.kind, desc: "", icon: "" }; + return h("li", {}, h("button", { type: "button", class: "fault-btn", style: `--i:${i}`, "aria-pressed": "false", "data-kind": f.kind, onclick: () => inject(f.kind) }, + h("span", { class: "f-top" }, h("span", { class: "f-icon", html: info.icon }), h("span", { class: "f-gate" }, `targets ${gateShort(f.intended_gate)}`)), + h("h2", {}, info.name), h("p", {}, info.desc), h("span", { class: "f-cta", "aria-hidden": "true" }, "Plant this defect →"))); + })); + const rec = m.evidence?.fault_recall || {}; + const intended = Object.fromEntries(m.fault_kinds.map((f) => [f.kind, f.intended_gate])); + $("#recall-table").replaceChildren(h("div", { class: "tbl-wrap" }, h("table", { class: "tbl" }, + h("caption", { class: "sr-only" }, "Planted-defect recall by defect class"), + h("thead", {}, h("tr", {}, h("th", { scope: "col" }, "Defect"), h("th", { scope: "col" }, "Intended gate"), h("th", { scope: "col", class: "num" }, "Recall"), h("th", { scope: "col" }, "Status"))), + h("tbody", {}, Object.entries(rec).map(([k, v]) => h("tr", {}, + h("th", { scope: "row" }, FAULTS[k]?.name || k), + h("td", {}, h("span", { class: "mono" }, gateShort(intended[k] || "")), ` ${gateLabel(intended[k] || "")}`), + h("td", { class: "num" }, pct(v)), + h("td", { html: v >= 1 ? `${ICON.check}All caught` : `${ICON.cross}Missed some` }))))))); +} + +let injecting = false; +async function inject(kind) { + if (injecting) return; + injecting = true; + const info = FAULTS[kind] || { name: kind }; + $$(".fault-btn").forEach((b) => b.setAttribute("aria-pressed", String(b.dataset.kind === kind))); + const stageEl = $("#lab-stage"); + const status = $("#lab-status"); + $("#lab-error").hidden = true; + status.textContent = `Planting defect: ${info.name}. Running all gates.`; + stageEl.hidden = false; + stageEl.replaceChildren( + h("div", { class: "lab-images" }, [0, 1].map(() => h("div", { class: "lab-img" }, h("span", { class: "skeleton sk-line", style: "width:40%;margin-bottom:8px" }), h("span", { class: "skeleton sk-img" })))), + h("div", {}, h("span", { class: "skeleton sk-title" }), Array.from({ length: 6 }, () => h("span", { class: "skeleton sk-line", style: "margin-bottom:12px" })))); + try { + const r = await api("/api/faults/inject", { body: { kind } }); + const gates = Object.entries(r.gates); + const rows = gates.map(([id, g]) => { + const li = h("li", { class: "gate-row pending", html: `${ICON.pending}${esc(gateShort(id))}${esc(gateLabel(id))}` }); + li._g = g; + return li; + }); + const stampSlot = h("div", { "aria-hidden": "true" }); + stageEl.replaceChildren( + h("div", { class: "lab-images" }, + h("div", { class: "lab-img" }, h("figure", {}, h("figcaption", { html: `${ICON.check.replace('class="vi"', 'class="vi" style="width:16px;height:16px;color:var(--pass)"')} Clean candidate` }), + h("div", { class: "frame" }, h("img", { src: r.clean_image, alt: "Clean candidate panel before the defect was planted." })))), + h("div", { class: "lab-img defect" }, h("figure", {}, h("figcaption", { html: `${ICON.cross.replace('class="vi"', 'class="vi" style="width:16px;height:16px;color:var(--fail)"')} With planted defect: ${esc(info.name)}` }), + h("div", { class: "frame" }, h("img", { src: r.image, alt: `The same panel with a planted defect: ${info.name.toLowerCase()}.` })))), + h("p", { class: "lab-q" }, h("strong", {}, "Question: "), r.question)), + h("div", { class: "lab-gates" }, h("h2", {}, "Gate battery"), h("ul", { class: "gate-list" }, rows), stampSlot)); + if (!reduced()) stageEl.scrollIntoView({ behavior: "smooth", block: "start" }); + else stageEl.scrollIntoView({ block: "start" }); + await wait(350); + for (const li of rows) { + li.classList.remove("pending"); + li.classList.add("scanning"); + await wait(230); + const g = li._g; + li.classList.remove("scanning"); + li.classList.add("checked", g.pass ? "pass" : "fail"); + li.innerHTML = `${g.pass ? ICON.check : ICON.cross}${li.innerHTML.replace(/^/, "")}`; + li.querySelector(".g-state").textContent = g.pass ? "Pass" : "Fail"; + li.querySelector(".g-detail").textContent = g.detail || ""; + if (!g.pass) await wait(260); + } + const first = r.caught_by[0]; + const label = r.caught ? `Caught by ${gateShort(first)} · ${gateLabel(first)}` : "Not caught"; + const others = r.caught_by.slice(1).map((g) => `${gateShort(g)} ${gateLabel(g)}`).join(", "); + stampSlot.removeAttribute("aria-hidden"); + stampSlot.append(h("div", { class: `stamp${r.caught ? "" : " missed"}` }, + h("small", {}, r.caught ? "Rejected" : "Shipped"), label, others ? h("small", {}, `also ${others}`) : null)); + const asDesigned = r.caught_by.includes(r.intended_gate) ? ` The intended gate, ${gateShort(r.intended_gate)}, fired as designed.` : ""; + status.textContent = r.caught + ? `Defect caught. Rejected by ${r.caught_by.map((g) => `${gateShort(g)} ${gateLabel(g)}`).join(" and ")}.${asDesigned}` + : "The defect was not caught by any gate."; + } catch (e) { + stageEl.hidden = true; + errorBox($("#lab-error"), e, () => inject(kind)); + status.textContent = `Injection failed: ${e.message}`; + } finally { + injecting = false; + } +} + +// ============================================================== CAPABILITY MAP +async function initMap() { + if (loaded.map) return; + loaded.map = true; + try { + const [r] = await Promise.all([api("/api/results"), getMeta().catch(() => null)]); + if (!r.available) { + $("#map-grid").replaceChildren(h("p", { class: "empty" }, "No evaluation results are available. Run the evaluation from the CLI first.")); + return; + } + state.results = r; + renderMap(true); + } catch (e) { + loaded.map = false; + $("#map-grid").replaceChildren(); + errorBox($("#map-error"), e, initMap); + } +} + +function chartCard({ id, title, desc, chart, table, span2 = false, i = 0, extra = null }) { + const chartBox = h("div", { class: "chart-body", id: `${id}-chart` }, chart); + const tableBox = h("div", { class: "chart-table", id: `${id}-table`, hidden: true }, table); + const btn = h("button", { type: "button", class: "btn btn-sm btn-ghost table-toggle", "aria-pressed": "false", "aria-controls": `${id}-chart ${id}-table`, + onclick: () => { + const on = btn.getAttribute("aria-pressed") !== "true"; + btn.setAttribute("aria-pressed", String(on)); + btn.textContent = on ? "View as chart" : "View as table"; + chartBox.hidden = on; + tableBox.hidden = !on; + hideTip(); + } }, "View as table"); + return h("section", { class: `card chart-card${span2 ? " span-2" : ""}`, style: `--i:${i}`, "aria-labelledby": `${id}-h` }, + h("div", { class: "chart-head" }, h("div", {}, h("h2", { id: `${id}-h` }, title), desc ? h("p", {}, desc) : null), h("div", { style: "display:flex;gap:8px;flex-wrap:wrap" }, extra, btn)), + chartBox, tableBox); +} + +function table(caption, head, rows, numCols = []) { + return h("div", { class: "tbl-wrap" }, h("table", { class: "tbl" }, + h("caption", {}, caption), + h("thead", {}, h("tr", {}, head.map((c, i) => h("th", { scope: "col", class: numCols.includes(i) ? "num" : "" }, c)))), + h("tbody", {}, rows.map((r) => h("tr", {}, r.map((c, i) => (i === 0 ? h("th", { scope: "row" }, c) : h("td", { class: numCols.includes(i) ? "num" : "" }, c)))))))); +} + +function renderMap(animate) { + const r = state.results; + const models = r.models; + const grid = $("#map-grid"); + mapWidth = chartWidth(); + const cards = [ + heatmapCard(r, models, 0), + lineCard(r, models, 1), + scatterCard(r, models, 2), + failCard(r, models, 3), + statsCard(r, models, 4), + ]; + grid.replaceChildren(...cards); + if (!animate) cards.forEach((c) => c.style.animation = "none"); + $$(".series-line", grid).forEach((path, i) => drawIn(path, animate ? 200 + i * 120 : 0, animate)); +} + +let mapWidth = 0; +function chartWidth() { + const g = $("#map-grid").clientWidth || 1000; + const one = window.matchMedia("(max-width: 900px)").matches; + const pad = window.matchMedia("(max-width: 640px)").matches ? 34 : 42; + return Math.round(clamp((one ? g : (g - 16) / 2) - pad, 280, 760)); +} +let mapResizeTimer; +window.addEventListener("resize", () => { + clearTimeout(mapResizeTimer); + mapResizeTimer = setTimeout(() => { + if (currentView === "map" && state.results && Math.abs(chartWidth() - mapWidth) > 16) renderMap(false); + }, 160); +}); + +function drawIn(path, delay, animate) { + if (!animate || reduced() || !path.getTotalLength) return; + const len = path.getTotalLength(); + path.animate([{ strokeDasharray: `${len} ${len}`, strokeDashoffset: len }, { strokeDasharray: `${len} ${len}`, strokeDashoffset: 0 }], + { duration: 1100, delay, easing: "cubic-bezier(.16,1,.3,1)", fill: "backwards" }); +} + +// --- (a) heatmap +function heatColor(p) { + const light = currentTheme() === "light"; + const lo = light ? [238, 244, 250] : [20, 33, 58]; + const hi = light ? [8, 85, 112] : [38, 190, 220]; + const t = Math.pow(clamp(p, 0, 1), 1.3); + let c = lo.map((v, i) => Math.round(v + (hi[i] - v) * t)); + const lum = (rgb) => { const [R, G, B] = rgb.map((v) => { v /= 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); }); return 0.2126 * R + 0.7152 * G + 0.0722 * B; }; + const ratio = (rgb, dark) => dark ? (lum(rgb) + 0.05) / 0.05 : 1.05 / (lum(rgb) + 0.05); + // WCAG AA (4.5:1) for the value text in every cell: pick black or white text, and if the + // mid-scale shade still falls short, nudge the shade toward the text's opposite pole. + const useDark = ratio(c, true) >= ratio(c, false); + for (let k = 0; k < 40 && ratio(c, useDark) < 4.6; k++) { + c = c.map((v) => Math.round(useDark ? v + (255 - v) * 0.06 : v * 0.94)); + } + return { bg: `rgb(${c.join(",")})`, fg: useDark ? "#000000" : "#FFFFFF" }; +} + +function opOrder(r) { + const instOps = state.meta?.families?.instruments?.ops || []; + return Object.keys(r.accuracy_by_op).sort((a, b) => { + const [fa, oa] = a.split(":"), [fb, ob] = b.split(":"); + if (fa !== fb) return fa === "instruments" ? -1 : 1; + const ia = instOps.indexOf(oa), ib = instOps.indexOf(ob); + return (ia < 0 ? 99 : ia) - (ib < 0 ? 99 : ib) || oa.localeCompare(ob); + }); +} + +function heatmapCard(r, models, i) { + const ops = opOrder(r); + const wrap = h("div", { class: "heat", role: "grid", "aria-label": "Accuracy by operation and model. Use arrow keys to move between cells.", style: `grid-template-columns:minmax(var(--heat-rh),auto) repeat(${models.length}, minmax(var(--heat-col),1fr))` }); + wrap.append(h("div", { role: "row", class: "heat-row" }, h("div", { role: "columnheader", class: "heat-colhead" }, h("span", { class: "sr-only" }, "Operation")), + models.map((m) => h("div", { role: "columnheader", class: "heat-colhead", title: mName(m) }, swatch(m), h("span", { "aria-hidden": "true" }, mShort(m)), h("span", { class: "sr-only" }, mName(m)))))); + const cellGrid = []; + let k = 0; + ops.forEach((op) => { + const [fam, name] = op.split(":"); + const row = []; + const rowEl = h("div", { role: "row", class: "heat-row" }, h("div", { role: "rowheader", class: "heat-rowhead", title: OP_INFO[name] || "" }, h("small", {}, fam === "wiring" ? "wire" : "inst"), name)); + models.forEach((m) => { + const v = r.accuracy_by_op[op][m]; + let cell; + if (!v) cell = h("div", { role: "gridcell", class: "heat-cell na", style: `--i:${k}` }, "n/a"); + else { + const [p, lo, hi, n] = v; + const c = heatColor(p); + cell = h("div", { role: "gridcell", class: "heat-cell", style: `background:${c.bg};color:${c.fg};--i:${k}`, + "aria-label": `${mName(m)}, ${op}: ${pct(p)} accuracy, 95% CI ${pct(lo)} to ${pct(hi)}, n ${n}` }, pct(p)); + bindTip(cell, `${esc(mName(m))}
${esc(op)} · ${esc(OP_INFO[name] || "")}
${pct(p, 1)} correct 95% CI ${pct(lo, 1)}–${pct(hi, 1)} · n = ${n}`); + } + row.push(cell); + rowEl.append(cell); + k++; + }); + cellGrid.push(row); + wrap.append(rowEl); + }); + roving(cellGrid); + const lo = heatColor(0).bg, mid = heatColor(0.5).bg, hi = heatColor(1).bg; + const chart = h("div", {}, h("div", { class: "heat-scroll" }, wrap), + h("div", { class: "heat-scale", "aria-hidden": "true" }, "0%", h("span", { class: "bar", style: `background:linear-gradient(90deg,${lo},${mid},${hi})` }), "100%", h("span", {}, " · accuracy, single-hue scale"))); + const tbl = table("Accuracy by operation (95% Wilson CI, n tasks)", ["Operation", ...models.map(mName)], + ops.map((op) => [op, ...models.map((m) => { const v = r.accuracy_by_op[op][m]; return v ? `${pct(v[0])} (${pct(v[1])}–${pct(v[2])}, n=${v[3]})` : "n/a"; })]), + models.map((_, j) => j + 1)); + return chartCard({ id: "heat", title: "Accuracy by operation", desc: "Rows are question programs, columns are models. Hover or focus a cell for its confidence interval and sample size.", chart, table: tbl, span2: true, i }); +} + +// --- (b) difficulty curve +let lineFamily = "wiring"; +function lineCard(r, models, i) { + const fams = Object.keys(r.accuracy_by_level || {}); + const body = h("div", {}); + const tblBox = h("div", {}); + const render = (animate) => { + const data = r.accuracy_by_level[lineFamily] || {}; + const levels = [...new Set(models.flatMap((m) => Object.keys(data[m] || {}).map(Number)))].sort((a, b) => a - b); + body.replaceChildren(lineChart(data, models, levels)); + tblBox.replaceChildren(table(`Accuracy by ${lineFamily} difficulty level`, ["Model", ...levels.map((l) => `Level ${l}`)], + models.map((m) => [mName(m), ...levels.map((l) => pct(data[m]?.[l] ?? data[m]?.[String(l)]))]), levels.map((_, j) => j + 1))); + $$(".series-line", body).forEach((p, j) => drawIn(p, 100 + j * 120, animate)); + }; + const seg = fams.length > 1 ? h("div", { class: "segmented", role: "radiogroup", "aria-label": "Task family" }, fams.map((f) => h("label", {}, + h("input", { type: "radio", name: "line-fam", value: f, checked: f === lineFamily, onchange: () => { lineFamily = f; render(true); updateDesc(); } }), h("span", {}, f[0].toUpperCase() + f.slice(1))))) : null; + const card = chartCard({ id: "line", title: "Difficulty curve", desc: "", chart: body, table: tblBox, i, extra: seg }); + const updateDesc = () => { + const p = card.querySelector(".chart-head p"); + p.textContent = lineFamily === "wiring" + ? "Accuracy by wiring level (16 tasks per level). More wires and crossings separate the models; Claude Opus 5.5 falls to 6 of 16 at level 6." + : "Accuracy by instrument difficulty level. The frontier models stay near the ceiling across all five levels."; + }; + card.querySelector(".chart-head > div").append(h("p", {})); + updateDesc(); + render(false); + return card; +} + +function lineChart(data, models, levels) { + const W = mapWidth || 680, H = Math.round(clamp(W * 0.5, 250, 330)), ml = 44, mr = W < 420 ? 112 : 140, mt = 14, mb = 42; + const iw = W - ml - mr, ih = H - mt - mb; + const x = (l) => ml + (levels.length > 1 ? ((l - levels[0]) / (levels[levels.length - 1] - levels[0])) * iw : iw / 2); + const y = (p) => mt + (1 - p) * ih; + const val = (m, l) => data[m]?.[l] ?? data[m]?.[String(l)]; + const svg = s("svg", { class: "chart-svg", viewBox: `0 0 ${W} ${H}`, role: "group", "aria-label": "Line chart of accuracy by difficulty level per model. Use arrow keys on the points; a table view is available." }); + [0, 0.25, 0.5, 0.75, 1].forEach((t) => { + svg.append(s("line", { x1: ml, x2: ml + iw, y1: y(t), y2: y(t), class: "grid" }), s("text", { x: ml - 8, y: y(t) + 4, "text-anchor": "end", class: "tick-label" }, pct(t))); + }); + levels.forEach((l) => svg.append(s("text", { x: x(l), y: mt + ih + 20, "text-anchor": "middle", class: "tick-label" }, String(l)))); + svg.append(s("text", { x: ml + iw / 2, y: H - 4, "text-anchor": "middle", class: "axis-label" }, "Difficulty level")); + const ptGrid = []; + const ends = []; + models.forEach((m) => { + const pts = levels.map((l) => [l, val(m, l)]).filter(([, v]) => v !== undefined && v !== null); + if (!pts.length) return; + svg.append(s("path", { d: pts.map(([l, v], j) => `${j ? "L" : "M"}${x(l).toFixed(1)},${y(v).toFixed(1)}`).join(""), class: "series-line", stroke: mColor(m), style: `stroke:${mColor(m)}` })); + const row = []; + pts.forEach(([l, v]) => { + const c = s("circle", { cx: x(l), cy: y(v), r: 4.5, class: "pt", style: `fill:${mColor(m)}`, role: "img", "aria-label": `${mName(m)}, level ${l}: ${pct(v)}` }); + bindTip(c, `${esc(mName(m))}
Level ${l}: ${pct(v, 1)}${lineFamily === "wiring" ? ` (${Math.round(v * 16)} of 16)` : ""}`); + row.push(c); + }); + ptGrid.push(row); + const last = pts[pts.length - 1]; + ends.push({ m, y: y(last[1]), v: last[1], x: x(last[0]) }); + }); + // points on top of lines + ptGrid.flat().forEach((c) => svg.append(c)); + // direct labels with simple collision avoidance + ends.sort((a, b) => a.y - b.y); + const gap = 17; + for (let k = 1; k < ends.length; k++) if (ends[k].y - ends[k - 1].y < gap) ends[k].ly = (ends[k - 1].ly ?? ends[k - 1].y) + gap; + ends.forEach((e) => { e.ly = e.ly ?? e.y; }); + for (let k = 1; k < ends.length; k++) if (ends[k].ly - ends[k - 1].ly < gap) ends[k].ly = ends[k - 1].ly + gap; + const overflow = ends.length ? ends[ends.length - 1].ly - (mt + ih + 6) : 0; + if (overflow > 0) ends.forEach((e) => { e.ly -= overflow; }); + ends.forEach((e) => { + const lx = ml + iw + 14; + svg.append(s("path", { d: `M${e.x + 6},${e.y} L${lx - 4},${e.ly}`, style: `stroke:${mColor(e.m)}`, "stroke-width": 1, fill: "none", opacity: 0.7 }), + s("rect", { x: lx, y: e.ly - 5, width: 10, height: 10, rx: 2, style: `fill:${mColor(e.m)}` }), + s("text", { x: lx + 15, y: e.ly + 4, class: "direct-label" }, mShort(e.m), s("tspan", { class: "direct-val", dx: 6 }, pct(e.v)))); + }); + roving(ptGrid); + const legend = h("ul", { class: "legend", "aria-label": "Legend" }, models.map((m) => h("li", {}, swatch(m), mName(m)))); + return h("div", {}, legend, svg); +} + +// --- (c) cost vs accuracy +function scatterCard(r, models, i) { + const W = mapWidth || 680, H = Math.round(clamp(W * 0.52, 260, 340)), ml = 52, mr = 24, mt = 20, mb = 46; + const narrowLabels = W < 560; + const iw = W - ml - mr, ih = H - mt - mb; + const pts = models.filter((m) => r.cost_per_task[m] && r.overall[m]).map((m) => ({ m, c: r.cost_per_task[m], p: r.overall[m][0], lo: r.overall[m][1], hi: r.overall[m][2], n: r.overall[m][3] })); + const lc = pts.map((q) => Math.log10(q.c)); + const x0 = Math.floor(Math.min(...lc) - 0.15), x1 = Math.ceil(Math.max(...lc) + 0.15); + const yMin = Math.max(0, Math.floor((Math.min(...pts.map((q) => q.lo)) - 0.05) * 10) / 10), yMax = 1; + const x = (c) => ml + ((Math.log10(c) - x0) / (x1 - x0)) * iw; + const y = (p) => mt + (1 - (p - yMin) / (yMax - yMin)) * ih; + const svg = s("svg", { class: "chart-svg", viewBox: `0 0 ${W} ${H}`, role: "group", "aria-label": "Scatter plot of cost per task (log scale) against overall accuracy. A table view is available." }); + for (let t = yMin; t <= 1.0001; t += 0.1) svg.append(s("line", { x1: ml, x2: ml + iw, y1: y(t), y2: y(t), class: "grid" }), s("text", { x: ml - 8, y: y(t) + 4, "text-anchor": "end", class: "tick-label" }, pct(t))); + for (let e = x0; e <= x1; e++) { + [1, 3].forEach((mult) => { + const c = mult * Math.pow(10, e); + if (Math.log10(c) > x1 + 1e-9) return; + svg.append(s("line", { x1: x(c), x2: x(c), y1: mt, y2: mt + ih, class: "grid", opacity: mult === 1 ? 1 : 0.5 })); + if (mult === 1 || (x1 - x0 <= 3 && W >= 480)) svg.append(s("text", { x: x(c), y: mt + ih + 18, "text-anchor": "middle", class: "tick-label" }, `$${c >= 0.01 ? c.toFixed(2) : c.toPrecision(1)}`)); + }); + } + svg.append(s("text", { x: ml + iw / 2, y: H - 6, "text-anchor": "middle", class: "axis-label" }, "Measured cost per task (USD, log scale)"), + s("text", { x: 14, y: mt + ih / 2, "text-anchor": "middle", class: "axis-label", transform: `rotate(-90 14 ${mt + ih / 2})` }, "Overall accuracy")); + // Pareto frontier + const sorted = [...pts].sort((a, b) => a.c - b.c); + const front = []; + sorted.forEach((q) => { if (!front.length || q.p > front[front.length - 1].p) front.push(q); }); + if (front.length > 1) svg.append(s("path", { class: "frontier", d: front.map((q, k) => `${k ? "L" : "M"}${x(q.c)},${y(q.p)}`).join("") })); + svg.append(s("text", { x: ml + 8, y: mt + 14, class: "annot" }, "↖ cheaper and more accurate")); + const dots = []; + pts.forEach((q) => { + svg.append(s("line", { x1: x(q.c), x2: x(q.c), y1: y(q.lo), y2: y(q.hi), class: "ci", style: `stroke:${mColor(q.m)}` })); + const c = s("circle", { cx: x(q.c), cy: y(q.p), r: 7, class: "pt", style: `fill:${mColor(q.m)}`, role: "img", "aria-label": `${mName(q.m)}: ${usd(q.c)} per task, ${pct(q.p, 1)} accuracy` }); + bindTip(c, `${esc(mName(q.m))}
${usd(q.c)} per task · ${pct(q.p, 1)}
95% CI ${pct(q.lo, 1)}–${pct(q.hi, 1)} · n = ${q.n}`); + dots.push(c); + }); + dots.forEach((d) => svg.append(d)); + // labels: place right of dot unless near the right edge; nudge apart vertically + const labs = pts.map((q) => ({ q, x: x(q.c), y: y(q.p), right: x(q.c) < ml + iw - (narrowLabels ? 90 : 150) })).sort((a, b) => a.y - b.y); + for (let k = 1; k < labs.length; k++) { + const prev = labs.slice(0, k).filter((p) => p.right === labs[k].right && Math.abs(p.x - labs[k].x) < 140); + for (const p of prev) if (Math.abs((labs[k].ly ?? labs[k].y) - (p.ly ?? p.y)) < 16) labs[k].ly = (p.ly ?? p.y) + 16; + } + labs.forEach((L) => { + const ly = L.ly ?? L.y; + svg.append(s("text", { x: L.right ? L.x + 12 : L.x - 12, y: ly + 4, "text-anchor": L.right ? "start" : "end", class: "direct-label" }, narrowLabels ? mShort(L.q.m) : mName(L.q.m), + s("tspan", { class: "direct-val", dx: 6 }, pct(L.q.p)))); + }); + roving([dots]); + const tbl = table("Overall accuracy and measured cost per task", ["Model", "Cost per task", "Accuracy", "95% CI", "n"], + pts.map((q) => [mName(q.m), usd(q.c), pct(q.p, 1), `${pct(q.lo, 1)}–${pct(q.hi, 1)}`, String(q.n)]), [1, 2, 3, 4]); + const chart = h("div", {}, svg, h("p", { class: "mini-note" }, "Dashed line: the cost/accuracy frontier. A model off the line has a rival that is both cheaper and at least as accurate on this benchmark. Vertical bars are 95% confidence intervals.")); + return chartCard({ id: "scatter", title: "Which model should I buy for this job?", desc: "Overall accuracy against the measured API cost per task in the final evaluation.", chart, table: tbl, i }); +} + +// --- (d) why models fail +function failCard(r, models, i) { + const all = models.flatMap((m) => Object.values(r.attribution[m] || {})); + const max = Math.max(1, ...all); + const pretty = (k) => { const [op, why] = k.split(":"); return [op, (why || "").replace(/_/g, " ")]; }; + const chart = h("div", { class: "fail-grid" }, models.map((m) => { + const entries = Object.entries(r.attribution[m] || {}).sort((a, b) => b[1] - a[1]).slice(0, 6); + const total = Object.values(r.attribution[m] || {}).reduce((a, b) => a + b, 0); + return h("div", { class: "fail-model" }, h("h3", {}, swatch(m), mName(m), h("small", {}, `${total} attributed error${total === 1 ? "" : "s"}`)), + entries.length ? entries.map(([k, v], j) => { + const [op, why] = pretty(k); + return h("div", { class: "fbar" }, h("span", { class: "fl" }, h("span", { class: "mono" }, op), why), + h("span", { class: "ft", "aria-hidden": "true" }, h("span", { style: `width:${(100 * v) / max}%;background:${mColor(m)};animation-delay:${j * 60}ms` })), + h("span", { class: "fv" }, String(v))); + }) : h("p", { class: "muted" }, "No errors to attribute.")); + })); + const rows = models.flatMap((m) => Object.entries(r.attribution[m] || {}).sort((a, b) => b[1] - a[1]).map(([k, v]) => { const [op, why] = pretty(k); return [mName(m), op, why, String(v)]; })); + const tbl = h("div", { class: "tbl-wrap" }, h("table", { class: "tbl" }, h("caption", {}, "Top error attributions per model (count of tasks)"), + h("thead", {}, h("tr", {}, ["Model", "Operation", "Attributed cause", "Errors"].map((c, j) => h("th", { scope: "col", class: j === 3 ? "num" : "" }, c)))), + h("tbody", {}, rows.map((rw) => h("tr", {}, h("th", { scope: "row" }, rw[0]), h("td", { class: "mono" }, rw[1]), h("td", {}, rw[2]), h("td", { class: "num" }, rw[3])))))); + return chartCard({ id: "fail", title: "Why models fail", desc: "Every wrong answer is attributed to a cause, because the spec knows what the right reading was. Same scale across models.", chart, table: tbl, span2: true, i }); +} + +// --- (e) blind baseline, twin consistency, human audit, ablation +function statsCard(r, models, i) { + const srows = (obj, labelFor) => h("div", { class: "stat-rows" }, models.filter((m) => obj[m]).map((m) => { + const [p, lo, hi] = obj[m]; + return h("div", { class: "srow" }, h("span", { class: "sm" }, swatch(m), mName(m)), + h("span", { class: "strack", "aria-hidden": "true" }, h("span", { style: `width:${p * 100}%;background:${mColor(m)}` }), h("span", { class: "ci-band", style: `left:${lo * 100}%;width:${(hi - lo) * 100}%` })), + h("span", { class: "sv" }, pct(p), h("span", { class: "sr-only" }, ` ${labelFor}, 95% CI ${pct(lo)} to ${pct(hi)}`))); + })); + const blindModels = models.filter((m) => r.blind?.[m]); + const chart = h("div", { class: "two-col" }, + h("div", {}, h("h3", { class: "mini-h" }, "Text-only blind baseline"), + srows(r.blind || {}, "correct without the image"), + h("p", { class: "mini-note" }, `Accuracy when the model gets the question but not the image${blindModels.length < models.length ? ` (measured for ${blindModels.length} models)` : ""}. Low is good: the tasks need the pixels.`)), + h("div", {}, h("h3", { class: "mini-h" }, "Twin consistency"), + srows(r.twin_both_correct || {}, "both twins correct"), + h("p", { class: "mini-note" }, "Share of answer-flip pairs where the model gets both the task and its twin right."), + r.human ? h("p", { class: "mini-note", style: "margin-top:16px" }, h("strong", { style: "color:var(--text)" }, `Human audit pilot: ${r.human.correct} of ${r.human.n} (${pct(r.human.accuracy)})`), " answered correctly by a person from the image alone.") : null)); + const rows = []; + models.forEach((m) => { + rows.push([mName(m), r.blind?.[m] ? `${pct(r.blind[m][0])} (${pct(r.blind[m][1])}–${pct(r.blind[m][2])})` : "not measured", + r.twin_both_correct?.[m] ? `${pct(r.twin_both_correct[m][0])} (${pct(r.twin_both_correct[m][1])}–${pct(r.twin_both_correct[m][2])})` : "not measured"]); + }); + const tbl = h("div", {}, table("Blind baseline and twin consistency (95% CI)", ["Model", "Blind (text only)", "Both twins correct"], rows, [1, 2]), + r.human ? h("p", { class: "mini-note" }, `Human audit pilot: ${r.human.correct} of ${r.human.n} correct (${pct(r.human.accuracy)}).`) : null); + const abl = r.ablation && Object.keys(r.ablation).length ? ablationBlock(r.ablation) : null; + const card = chartCard({ id: "stats", title: "Sanity checks", desc: "Is the image necessary, and are answers consistent under a minimal edit?", chart, table: tbl, span2: true, i }); + if (abl) card.append(abl); + return card; +} + +function ablationBlock(abl) { + const ms = Object.keys(abl); + return h("div", { style: "margin-top:20px" }, h("h3", { class: "mini-h" }, "Variation sensitivity (ablation)"), + table("Accuracy on base tasks vs surface (cosmetic) and structural variations, and how often correctness flips", ["Model", "Triples", "Base", "Surface", "Structure", "Flip rate, surface", "Flip rate, structure"], + ms.map((m) => { const a = abl[m]; return [mName(m), String(a.n_triples), pct(a.acc_base?.[0]), pct(a.acc_surface?.[0]), pct(a.acc_structure?.[0]), pct(a.correctness_flip_rate_surface?.[0]), pct(a.correctness_flip_rate_structure?.[0])]; }), + [1, 2, 3, 4, 5, 6]), + h("p", { class: "mini-note" }, "Structural changes flip correctness more often than cosmetic ones: the variation measures perception, not paint.")); +} + +// ============================================================== SHIP IT +const est = { n: 1000, reasoning: "low", batch: false, models: new Set() }; +const sliderToN = (v) => { const raw = Math.pow(10, 1 + (v * 6) / 100); const mag = Math.pow(10, Math.floor(Math.log10(raw)) - 1); return Math.round(raw / mag) * mag; }; +const nToSlider = (n) => clamp(((Math.log10(Math.max(10, n)) - 1) * 100) / 6, 0, 100); + +async function initShip() { + populateExportSelect(); + renderCurl(); + if (loaded.ship) return; + loaded.ship = true; + const range = $("#est-n-range"), num = $("#est-n"); + range.value = nToSlider(est.n); + const syncOut = () => { + $("#est-n-out").textContent = `${fmtInt(est.n)} tasks`; + range.setAttribute("aria-valuetext", `${fmtInt(est.n)} tasks`); + }; + syncOut(); + range.addEventListener("input", () => { est.n = sliderToN(Number(range.value)); num.value = est.n; syncOut(); scheduleEstimate(); }); + num.addEventListener("input", () => { + const v = parseInt(num.value, 10); + if (Number.isFinite(v) && v >= 1) { est.n = Math.min(v, 10000000); range.value = nToSlider(est.n); syncOut(); scheduleEstimate(); } + }); + $("#est-form").addEventListener("submit", (e) => e.preventDefault()); + $$('input[name="reasoning"]').forEach((r) => r.addEventListener("change", () => { est.reasoning = r.value; scheduleEstimate(); })); + const sw = $("#est-batch"); + sw.addEventListener("click", () => { est.batch = !est.batch; sw.setAttribute("aria-checked", String(est.batch)); scheduleEstimate(); }); + try { + const [mods] = await Promise.all([api("/api/models"), getMeta().catch(() => null)]); + state.models = mods.models; + let defaults = state.results?.models; + if (!defaults) { try { defaults = (await api("/api/results")).models; } catch (_) { defaults = []; } } + mods.models.forEach((m) => { if (defaults.includes(m.id)) est.models.add(m.id); }); + if (!est.models.size) mods.models.slice(0, 2).forEach((m) => est.models.add(m.id)); + $("#est-models").replaceChildren(...mods.models.map((m) => h("label", { class: "check" }, + h("input", { type: "checkbox", value: m.id, checked: est.models.has(m.id), onchange: (e) => { e.target.checked ? est.models.add(m.id) : est.models.delete(m.id); scheduleEstimate(); } }), + h("span", {}, mName(m.id)), h("span", { class: "prov" }, m.provider)))); + scheduleEstimate(0); + } catch (e) { + loaded.ship = false; + $("#est-result").replaceChildren(h("div", { class: "error-box" }, h("strong", {}, "Could not load models. "), e.message)); + } +} + +let estTimer, estToken = 0; +function scheduleEstimate(delay = 220) { clearTimeout(estTimer); estTimer = setTimeout(runEstimate, delay); } +async function runEstimate() { + const out = $("#est-result"); + if (!est.models.size) { out.replaceChildren(h("p", { class: "muted" }, "Select at least one model to estimate.")); return; } + const token = ++estToken; + out.setAttribute("aria-busy", "true"); + try { + const r = await api("/api/estimate", { body: { n_tasks: est.n, models: [...est.models], reasoning: est.reasoning, batch: est.batch } }); + if (token !== estToken) return; + const isMeasured = (b) => /measured/i.test(b || ""); + const totalEl = h("span", { class: "big" }, usd(r.usd_total)); + out.replaceChildren( + h("div", { class: "est-total" }, h("div", {}, h("span", { class: "ctl-label" }, `Evaluate ${fmtInt(r.n_tasks)} tasks on ${r.rows.length} model${r.rows.length === 1 ? "" : "s"}`), totalEl), + h("span", { class: "gen" }, `Generation: ${usd(r.generation_usd)} · ≈ ${r.generation_cpu_minutes} CPU-minutes`)), + h("div", { class: "tbl-wrap" }, h("table", { class: "tbl" }, h("caption", { class: "sr-only" }, "Estimated evaluation cost per model"), + h("thead", {}, h("tr", {}, h("th", { scope: "col" }, "Model"), h("th", { scope: "col", class: "num" }, "Per task"), h("th", { scope: "col", class: "num" }, "Total"), h("th", { scope: "col" }, "Basis"))), + h("tbody", {}, r.rows.map((row) => h("tr", {}, h("th", { scope: "row" }, mName(row.model), h("span", { class: "hint", style: "display:block;margin:0" }, row.provider)), + h("td", { class: "num" }, usd(row.usd_per_task)), h("td", { class: "num" }, usd(row.usd_total)), + h("td", {}, h("span", { class: `basis${isMeasured(row.basis) ? " measured" : ""}`, title: row.basis }, isMeasured(row.basis) ? "measured" : "price-list"))))), + h("tfoot", {}, h("tr", {}, h("th", { scope: "row" }, "Total"), h("td", {}), h("td", { class: "num" }, usd(r.usd_total)), h("td", {}))))), + h("p", { class: "hint" }, h("strong", {}, "measured"), " = mean cost actually billed in the final evaluation (low reasoning); ", h("strong", {}, "price-list"), " = list-price formula. ", r.assumptions)); + } catch (e) { + if (token !== estToken) return; + out.replaceChildren(h("div", { class: "error-box" }, h("strong", {}, "Estimate failed. "), e.message)); + } finally { + if (token === estToken) out.removeAttribute("aria-busy"); + } +} + +async function populateExportSelect() { + const sel = $("#export-select"); + if (!sel) return; + if (!state.runs.length) await refreshRuns(); + const ids = [...new Set([state.lastGenerated, ...state.runs.map((r) => r.run_id), "final-instruments"].filter(Boolean))]; + const prev = sel.value; + sel.replaceChildren(...ids.map((id) => h("option", { value: id }, id === "final-instruments" ? "final-instruments (frozen evidence set)" : `${id}${id === state.lastGenerated ? " (latest)" : ""}`))); + sel.value = state.lastGenerated || (ids.includes(prev) ? prev : ids[0]); + if (!sel._bound) { sel.addEventListener("change", renderExportBtns); sel._bound = true; } + renderExportBtns(); +} +function renderExportBtns() { + const id = $("#export-select").value; + $("#export-run").textContent = state.lastGenerated ? `Latest generated run: ${state.lastGenerated}` : "No batch generated in this session yet; pick any run."; + const fmts = [["jsonl", "JSONL + images"], ["harbor", "Harbor 0.25"], ["bundle", "Task bundle"]]; + $("#export-btns").replaceChildren(...fmts.map(([f, label]) => h("a", { class: `btn ${f === "jsonl" ? "btn-primary" : "btn-ghost"}`, href: `/api/export/${encodeURIComponent(id)}?format=${f}`, + download: `needlepoint-${id}-${f}.zip`, html: `${ICON.download}${label}` }))); +} + +function renderCurl() { + const o = location.origin; + const lines = [ + ["c-m", "# generate 8 certified instrument tasks, reproducibly"], + ["", `curl -s -X POST ${o}/api/generate \\`], + ["", " -H 'content-type: application/json' \\"], + ["", ` -d '{"family":"instruments","n":8,"seed":42,"difficulty":[1,2,3]}'`], + ["", ""], + ["c-m", "# then download it as JSONL + images"], + ["", `curl -OJ "${o}/api/export/?format=jsonl"`], + ]; + const plain = lines.map((l) => l[1]).join("\n"); + $("#curl-snippet").innerHTML = lines.map(([c, t]) => { + if (c) return `${esc(t)}`; + return esc(t).replace(/^(curl)/, '$1').replace(/('\{.*\}')/, '$1'); + }).join("\n"); + const btn = $("#copy-curl"); + btn.onclick = () => copyText(plain, "curl command"); +} + +// ============================================================== HOW IT WORKS +const HOW_NODES = [ + ["Seed", "an integer"], ["Spec", "typed, answer known"], ["Render", "deterministic PNG"], ["Question program", "question + answer key"], + ["Gates", "incl. image-only decoder"], ["Answer-flip twin", "one minimal edit"], ["Certificate", "seed · hashes · trace"], + ["Export", "Harbor · JSONL"], ["Evaluation", "models, attributed errors"], +]; +let howMode = null; +function initHow() { renderHow(); } +function renderHow() { + const box = $("#how-diagram"); + const narrow = box.clientWidth < 640; + const mode = narrow ? "v" : "h"; + if (mode === howMode && box.firstChild) return; + howMode = mode; + const pos = []; + let W, H, nw, nh; + if (!narrow) { + W = 1000; nw = 164; nh = 62; H = 292; + const xs = [10, 207, 404, 601, 798]; + HOW_NODES.forEach((_, k) => { + if (k < 5) pos.push([xs[k], 104]); + else pos.push([xs[4 - (k - 5)], 224]); + }); + } else { + W = 340; nw = 210; nh = 56; const gap = 30; + HOW_NODES.forEach((_, k) => pos.push([10, 10 + k * (nh + gap)])); + H = 10 + HOW_NODES.length * (nh + gap); + } + const svg = s("svg", { viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": "Pipeline diagram from seed to evaluation." }, + s("defs", {}, s("marker", { id: "dg-arr", viewBox: "0 0 10 10", refX: 9, refY: 5, markerWidth: 7, markerHeight: 7, orient: "auto-start-reverse" }, s("path", { d: "M0,0 L10,5 L0,10 z", class: "dg-arrow" })), + s("marker", { id: "dg-arr-r", viewBox: "0 0 10 10", refX: 9, refY: 5, markerWidth: 7, markerHeight: 7, orient: "auto-start-reverse" }, s("path", { d: "M0,0 L10,5 L0,10 z", style: "fill:var(--fail)" })))); + const center = (k) => [pos[k][0] + nw / 2, pos[k][1] + nh / 2]; + for (let k = 0; k < HOW_NODES.length - 1; k++) { + const [ax, ay] = pos[k], [bx, by] = pos[k + 1]; + let d; + if (!narrow) { + if (k < 4) d = `M${ax + nw},${ay + nh / 2} L${bx - 2},${by + nh / 2}`; + else if (k === 4) d = `M${ax + nw / 2},${ay + nh} L${bx + nw / 2},${by - 2}`; + else d = `M${ax},${ay + nh / 2} L${bx + nw + 2},${by + nh / 2}`; + } else d = `M${ax + nw / 2},${ay + nh} L${bx + nw / 2},${by - 2}`; + svg.append(s("path", { d, class: "dg-edge", "marker-end": "url(#dg-arr)" }), s("path", { d, class: "dg-flow" })); + } + // rejection branch from Gates + const [gx, gy] = pos[4]; + if (!narrow) { + svg.append(s("path", { d: `M${gx + nw / 2},${gy} L${gx + nw / 2},${gy - 52}`, class: "dg-reject", "marker-end": "url(#dg-arr-r)" }), + s("rect", { x: gx + 2, y: gy - 100, width: nw - 4, height: 44, rx: 10, style: "fill:var(--fail-bg);stroke:var(--fail);stroke-dasharray:3 4" }), + s("text", { x: gx + nw / 2, y: gy - 82, "text-anchor": "middle", class: "dg-reject-text" }, "any gate fails"), + s("text", { x: gx + nw / 2, y: gy - 66, "text-anchor": "middle", class: "dg-reject-text" }, "→ rejection log")); + } else { + svg.append(s("path", { d: `M${gx + nw},${gy + nh / 2} L${gx + nw + 28},${gy + nh / 2}`, class: "dg-reject", "marker-end": "url(#dg-arr-r)" }), + s("text", { x: gx + nw + 32, y: gy + nh / 2 - 4, class: "dg-reject-text" }, "fail →"), + s("text", { x: gx + nw + 32, y: gy + nh / 2 + 10, class: "dg-reject-text" }, "rejected")); + } + HOW_NODES.forEach(([name, sub], k) => { + const [x0, y0] = pos[k]; + const key = k === 4; + svg.append(s("g", { class: `dg-node${key ? " key" : ""}` }, + s("rect", { x: x0, y: y0, width: nw, height: nh, rx: 12 }), + s("text", { x: x0 + 10, y: y0 + 15, class: "dg-num" }, String(k + 1).padStart(2, "0")), + s("text", { x: x0 + nw / 2, y: y0 + nh / 2 + 2 }, name), + s("text", { x: x0 + nw / 2, y: y0 + nh / 2 + 18, class: "dg-sub" }, sub))); + }); + void center; + box.replaceChildren(svg); +} +let howResize; +window.addEventListener("resize", () => { clearTimeout(howResize); howResize = setTimeout(() => { if (currentView === "how") renderHow(); }, 150); }); + +// ============================================================== boot +motionQuery.addEventListener?.("change", () => document.documentElement.classList.toggle("reduce-motion", reduced())); +document.documentElement.classList.toggle("reduce-motion", reduced()); +getMeta().catch(() => {}); +route(); diff --git a/studio/static/brand/favicon.svg b/studio/static/brand/favicon.svg new file mode 100644 index 0000000000000000000000000000000000000000..09f54b3a3940ebe8877c3f8c6acec1bc65905768 --- /dev/null +++ b/studio/static/brand/favicon.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/studio/static/brand/logo-mark-transparent.svg b/studio/static/brand/logo-mark-transparent.svg new file mode 100644 index 0000000000000000000000000000000000000000..f348d4227e894ad615864d49839cf88392a3a0d3 --- /dev/null +++ b/studio/static/brand/logo-mark-transparent.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/studio/static/brand/logo-mark.svg b/studio/static/brand/logo-mark.svg new file mode 100644 index 0000000000000000000000000000000000000000..67590eff11e65a9e03b3bb36372ed2be8ede117b --- /dev/null +++ b/studio/static/brand/logo-mark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/studio/static/brand/logo-wordmark-dark.svg b/studio/static/brand/logo-wordmark-dark.svg new file mode 100644 index 0000000000000000000000000000000000000000..ae2778f44d655bf464a5a80a8dc3d14811bf3f7f --- /dev/null +++ b/studio/static/brand/logo-wordmark-dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/studio/static/brand/logo-wordmark.svg b/studio/static/brand/logo-wordmark.svg new file mode 100644 index 0000000000000000000000000000000000000000..5153e462fa4234d35ebf76069c65fa444ef190da --- /dev/null +++ b/studio/static/brand/logo-wordmark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/studio/static/fonts/LICENSE_DEJAVU b/studio/static/fonts/LICENSE_DEJAVU new file mode 100644 index 0000000000000000000000000000000000000000..254e2cc42a6d0135cccf2047768b9e44f25e666f --- /dev/null +++ b/studio/static/fonts/LICENSE_DEJAVU @@ -0,0 +1,99 @@ +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ diff --git a/studio/static/fonts/np-mono.woff2 b/studio/static/fonts/np-mono.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..c73616b4236d3d00b3bf05d2d0da7f9e4b96a9c5 Binary files /dev/null and b/studio/static/fonts/np-mono.woff2 differ diff --git a/studio/static/fonts/np-sans-bold.woff2 b/studio/static/fonts/np-sans-bold.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..c5e2b3f7e81464f606c129f468dc8c4bd7664879 Binary files /dev/null and b/studio/static/fonts/np-sans-bold.woff2 differ diff --git a/studio/static/fonts/np-sans.woff2 b/studio/static/fonts/np-sans.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..18fd594acd414642b4c51eaa47464fcf3ec19b61 Binary files /dev/null and b/studio/static/fonts/np-sans.woff2 differ diff --git a/studio/static/index.html b/studio/static/index.html new file mode 100644 index 0000000000000000000000000000000000000000..065ece79426e9701e41d3fd9e611b485ff8072a9 --- /dev/null +++ b/studio/static/index.html @@ -0,0 +1,334 @@ + + + + + + + +NEEDLEPOINT Studio + + + + + + + + + + +
+
+ + + + Studio + + + + +
+
+ +
+ + +
+
+
+

Innodata AI Hackathon 2026 · Track 2 · Visual Task Factory

+

Certified visual tasks.
Every answer, proven from the pixels.

+

NEEDLEPOINT generates evaluation tasks for multimodal models from industrial control cabinets: analog dials, linear gauges, 7-segment displays, alarm bands and wiring diagrams. Ground truth comes first, and a task only ships if an image-only decoder re-derives the answer from the rendered pixels and every validation gate passes.

+ +
+
+
+ +
    +
  • +
  • +
  • +
  • +
+ +
+
+ +

Ground truth first

+

Each task starts as a typed spec with a known answer. The image is rendered from the spec, then a question program turns the spec into a question and an answer key.

+
+
+ +

Proven from the pixels

+

An image-only decoder reads every needle, fill level and digit back from the PNG. If it disagrees with the spec, the task is rejected. You can watch the proof draw itself in the Inspector.

+
+
+ +

Mutation-tested gates

+

We planted six kinds of defect (hidden needles, illegible labels, wrong answer keys, leaks) and the gates caught every one. Try it yourself in the Verifier Lab.

+
+
+ + +
+ + + + + + + + + + + + + + + +
+ + + + + +
+ + + + diff --git a/studio/static/styles.css b/studio/static/styles.css new file mode 100644 index 0000000000000000000000000000000000000000..db6ac77d0dbe4750618222ef2a6dd886f1025471 --- /dev/null +++ b/studio/static/styles.css @@ -0,0 +1,880 @@ +/* NEEDLEPOINT Studio: precision-instrument UI. No external resources. */ + +/* ------------------------------------------------------------------ fonts + Bundled DejaVu (Bitstream Vera licence, see /static/fonts/LICENSE_DEJAVU), subset to the + characters the Studio and its data use: the page renders identically on every OS, offline, + and matches the logo wordmark (outlined DejaVu Sans Bold). 65 KB total. */ +@font-face { font-family: "NP Sans"; src: url("/static/fonts/np-sans.woff2") format("woff2"); + font-weight: 400; font-style: normal; font-display: swap; } +@font-face { font-family: "NP Sans"; src: url("/static/fonts/np-sans-bold.woff2") format("woff2"); + font-weight: 600 800; font-style: normal; font-display: swap; } +@font-face { font-family: "NP Mono"; src: url("/static/fonts/np-mono.woff2") format("woff2"); + font-weight: 400 700; font-style: normal; font-display: swap; } + +/* ------------------------------------------------------------------ tokens */ +:root { + --font-ui: "NP Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + --font-mono: "NP Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; + + --ease-out: cubic-bezier(.16, 1, .3, 1); + --ease-io: cubic-bezier(.65, 0, .35, 1); + --t-fast: 150ms; + --t-ui: 220ms; + --t-slow: 300ms; + + --r-sm: 8px; + --r-md: 12px; + --r-lg: 16px; + --r-xl: 22px; + + --brand-teal: #22D3EE; + --brand-violet: #7C5CFF; + --brand-red: #FF4D5E; +} + +/* Dark is the default theme. */ +:root, +:root[data-theme="dark"] { + color-scheme: dark; + --bg: #070C17; + --bg-2: #0B1220; + --surface: rgba(22, 35, 63, .52); + --surface-solid: #111B30; + --surface-2: rgba(22, 35, 63, .82); + --surface-hover: rgba(34, 52, 92, .6); + --border: rgba(148, 163, 184, .16); + --border-strong: rgba(148, 163, 184, .3); + --text: #E8EEF7; + --text-2: #B6C2D4; + --muted: #8C9AB0; + --accent: #22D3EE; /* teal for UI */ + --accent-text: #5EE3F5; /* teal used as text */ + --accent-ink: #04212A; /* text on teal */ + --violet: #7C5CFF; + --violet-text: #A895FF; + --pass: #34D399; + --pass-bg: rgba(52, 211, 153, .12); + --fail: #FF4D5E; /* alarm / failure only */ + --fail-text: #FF8591; + --fail-bg: rgba(255, 77, 94, .12); + --focus: #22D3EE; + --grid-line: rgba(124, 150, 200, .07); + --glow: rgba(34, 211, 238, .14); + --glow-2: rgba(124, 92, 255, .14); + --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 40px -18px rgba(0, 0, 0, .7); + --skeleton: rgba(148, 163, 184, .1); + --skeleton-hi: rgba(148, 163, 184, .2); + --overlay: rgba(3, 7, 15, .66); + --img-bg: #0E1626; + + --m-gpt-6-2-astra: #3987e5; + --m-claude-opus-5-5: #d95926; + --m-gpt-6-luna: #199e70; + --m-claude-haiku-5-5: #c98500; + --m-gemini-3-1-flash-lite: #d55181; + + /* sequential heat scale endpoints (single hue) */ + --heat-lo: 214 40% 16%; + --heat-hi: 190 85% 52%; +} + +:root[data-theme="light"] { + color-scheme: light; + --bg: #F4F6FA; + --bg-2: #FFFFFF; + --surface: rgba(255, 255, 255, .78); + --surface-solid: #FFFFFF; + --surface-2: rgba(255, 255, 255, .95); + --surface-hover: rgba(226, 232, 244, .8); + --border: rgba(15, 23, 42, .11); + --border-strong: rgba(15, 23, 42, .22); + --text: #0B1220; + --text-2: #334155; + --muted: #55627A; + --accent: #0891B2; + --accent-text: #0E7490; + --accent-ink: #FFFFFF; + --violet: #6A4BF2; + --violet-text: #5536D8; + --pass: #047857; + --pass-bg: rgba(4, 120, 87, .09); + --fail: #D92D41; + --fail-text: #B4232F; + --fail-bg: rgba(217, 45, 65, .08); + --focus: #0891B2; + --grid-line: rgba(15, 40, 90, .055); + --glow: rgba(34, 211, 238, .18); + --glow-2: rgba(124, 92, 255, .12); + --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 32px -16px rgba(15, 23, 42, .18); + --skeleton: rgba(15, 23, 42, .06); + --skeleton-hi: rgba(15, 23, 42, .12); + --overlay: rgba(15, 23, 42, .45); + --img-bg: #E8EDF5; + + --m-gpt-6-2-astra: #2a78d6; + --m-claude-opus-5-5: #eb6834; + --m-gpt-6-luna: #1baf7a; + --m-claude-haiku-5-5: #eda100; + --m-gemini-3-1-flash-lite: #e87ba4; + + --heat-lo: 200 40% 96%; + --heat-hi: 200 85% 30%; +} + +/* ------------------------------------------------------------------ base */ +*, *::before, *::after { box-sizing: border-box; } +html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; } +body { + margin: 0; + font: 15px/1.55 var(--font-ui); + color: var(--text); + background-color: var(--bg); + background-image: + radial-gradient(900px 500px at 85% -10%, var(--glow), transparent 70%), + radial-gradient(700px 500px at -10% 30%, var(--glow-2), transparent 70%), + linear-gradient(var(--grid-line) 1px, transparent 1px), + linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); + background-size: auto, auto, 32px 32px, 32px 32px; + background-attachment: fixed; + min-height: 100vh; + display: flex; + flex-direction: column; + -webkit-font-smoothing: antialiased; + transition: background-color var(--t-slow) var(--ease-out), color var(--t-slow) var(--ease-out); +} +img, svg { max-width: 100%; } +h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; } +h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); font-weight: 700; } +h2 { font-size: 1.12rem; font-weight: 650; } +h3 { font-size: 1rem; font-weight: 650; } +p { margin: 0 0 1em; } +a { color: var(--accent-text); text-underline-offset: 3px; } +a:hover { text-decoration-thickness: 2px; } +code, kbd, pre, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; } +kbd { + font-size: .75em; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; + border-radius: 5px; background: var(--surface-2); color: var(--text-2); +} +.muted { color: var(--muted); } +.hint { color: var(--muted); font-size: .82rem; margin: .35em 0 0; font-weight: 400; } +.sr-only { + position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; + overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; +} +[hidden] { display: none !important; } + +:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; } +[tabindex="-1"]:focus { outline: none; } + +.skip-link { + position: fixed; left: 12px; top: -60px; z-index: 1000; + background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-sm); + font-weight: 650; text-decoration: none; transition: top var(--t-ui) var(--ease-out); +} +.skip-link:focus { top: 12px; } + +/* ------------------------------------------------------------------ top bar */ +.topbar { + position: sticky; top: 0; z-index: 50; + background: color-mix(in srgb, var(--bg) 78%, transparent); + backdrop-filter: saturate(160%) blur(14px); + -webkit-backdrop-filter: saturate(160%) blur(14px); + border-bottom: 1px solid var(--border); +} +.topbar-inner { + max-width: 1240px; margin: 0 auto; padding: 10px 20px; + display: flex; align-items: center; gap: 16px; min-height: 60px; +} +.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); flex-shrink: 0; border-radius: 6px; } +.brand-wordmark { height: 28px; width: auto; display: block; } +.brand-on-light { display: none; } +:root[data-theme="light"] .brand-on-dark { display: none; } +:root[data-theme="light"] .brand-on-light { display: block; } +.brand-studio { + font: 600 .7rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; + color: var(--accent-text); border: 1px solid var(--border-strong); padding: 4px 6px; border-radius: 6px; +} +.primary-nav { margin-left: auto; } +.primary-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; } +.primary-nav a { + display: block; padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; + color: var(--text-2); font-weight: 550; font-size: .92rem; position: relative; + transition: color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); +} +.primary-nav a:hover { color: var(--text); background: var(--surface-hover); } +.primary-nav a[aria-current="page"] { color: var(--text); } +.primary-nav a[aria-current="page"]::after { + content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; + background: linear-gradient(90deg, var(--brand-teal), var(--brand-violet)); + animation: grow-x var(--t-slow) var(--ease-out); +} +@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } } + +.icon-btn { + display: inline-flex; align-items: center; justify-content: center; gap: 6px; + min-width: 36px; min-height: 36px; padding: 6px 8px; + border: 1px solid var(--border); border-radius: var(--r-sm); + background: var(--surface); color: var(--text-2); cursor: pointer; font: inherit; font-size: .85rem; + transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast); +} +.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); } +.icon-btn:active { transform: scale(.96); } +.icon-btn:disabled { opacity: .45; cursor: not-allowed; } +.nav-toggle { display: none; margin-left: auto; } +.theme-toggle .i-moon { display: none; } +:root[data-theme="light"] .theme-toggle .i-sun { display: none; } +:root[data-theme="light"] .theme-toggle .i-moon { display: block; } +.theme-toggle-label { font-size: .82rem; } + +/* ------------------------------------------------------------------ layout */ +main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 20px 64px; outline: none; } +.view { animation: view-in 420ms var(--ease-out) both; } +@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } } +.view-head { margin: 8px 0 28px; max-width: 760px; } +.lede { color: var(--text-2); font-size: 1.04rem; margin: 0; } +.eyebrow { + font: 600 .72rem/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; + color: var(--accent-text); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; +} + +.card { + background: var(--surface); + border: 1px solid var(--border); + border-radius: var(--r-lg); + box-shadow: var(--shadow); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + padding: 20px; +} + +/* ------------------------------------------------------------------ buttons & inputs */ +.btn { + display: inline-flex; align-items: center; justify-content: center; gap: 8px; + min-height: 40px; padding: 8px 16px; border-radius: var(--r-sm); + border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem; + text-decoration: none; cursor: pointer; white-space: nowrap; + transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-ui), color var(--t-fast); +} +.btn:active { transform: translateY(1px) scale(.985); } +.btn-lg { min-height: 46px; padding: 10px 20px; font-size: .98rem; } +.btn-sm { min-height: 32px; padding: 4px 12px; font-size: .84rem; } +.btn-primary { + color: #04121A; background: linear-gradient(135deg, #22D3EE, #67E8F9 60%, #A5B4FC); + box-shadow: 0 0 0 1px rgba(34, 211, 238, .4), 0 8px 24px -8px rgba(34, 211, 238, .55); +} +.btn-primary:hover { box-shadow: 0 0 0 1px rgba(34, 211, 238, .7), 0 10px 32px -8px rgba(34, 211, 238, .75); } +.btn-primary:disabled { opacity: .6; cursor: progress; } +.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--border-strong); } +.btn-ghost:hover { background: var(--surface-hover); } +.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; } + +.input, select { + font: inherit; color: var(--text); background: var(--bg-2); + border: 1px solid var(--border-strong); border-radius: var(--r-sm); + min-height: 40px; padding: 6px 10px; width: 100%; + transition: border-color var(--t-fast), box-shadow var(--t-fast); +} +.input:hover, select:hover { border-color: var(--muted); } +.input:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); } +.input-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; } +.select-wrap { position: relative; } +.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; } +.select-wrap::after { + content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; pointer-events: none; + border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); +} + +fieldset { border: 0; padding: 0; margin: 0; min-width: 0; } +legend, .ctl-label { display: block; font-size: .78rem; font-weight: 650; color: var(--text-2); margin-bottom: 6px; letter-spacing: .02em; padding: 0; } +legend .hint { display: inline; font-size: .75rem; } + +.segmented { + display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; + background: var(--bg-2); border: 1px solid var(--border-strong); +} +.segmented label { position: relative; } +.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; } +.segmented span { + display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; border-radius: 7px; + font-size: .88rem; font-weight: 600; color: var(--text-2); cursor: pointer; + transition: background-color var(--t-ui) var(--ease-out), color var(--t-fast); +} +.segmented input:checked + span { background: var(--surface-hover); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong) inset; } +.segmented input:checked + span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; } +.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; } + +.chips { display: flex; flex-wrap: wrap; gap: 6px; } +.chip-toggle { + min-width: 40px; min-height: 36px; padding: 4px 12px; border-radius: 999px; + border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text-2); + font: 600 .88rem var(--font-mono); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; + transition: all var(--t-fast) var(--ease-out); +} +.chip-toggle:hover { border-color: var(--muted); color: var(--text); } +.chip-toggle[aria-pressed="true"] { + background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--text); +} +.chip-toggle .tick { width: 12px; height: 12px; opacity: 0; transform: scale(.4); transition: all var(--t-fast) var(--ease-out); } +.chip-toggle[aria-pressed="true"] .tick { opacity: 1; transform: none; } + +.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; color: var(--text-2); font: inherit; font-size: .88rem; cursor: pointer; min-height: 36px; } +.switch-track { width: 40px; height: 24px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border-strong); position: relative; transition: background-color var(--t-ui); } +.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform var(--t-ui) var(--ease-out), background-color var(--t-ui); } +.switch[aria-checked="true"] .switch-track, .switch[aria-pressed="true"] .switch-track { background: color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); } +.switch[aria-checked="true"] .switch-thumb, .switch[aria-pressed="true"] .switch-thumb { transform: translateX(16px); background: var(--accent); } +.switch:focus-visible { outline: none; } +.switch:focus-visible .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; } + +/* ------------------------------------------------------------------ skeletons */ +.skeleton { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-hi) 50%, var(--skeleton) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; } +@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } } +.sk-num { height: 34px; width: 60%; margin-bottom: 10px; } +.sk-line { height: 12px; width: 85%; } +.sk-title { height: 18px; width: 40%; margin-bottom: 16px; } +.sk-block { height: 260px; width: 100%; } +.sk-img { aspect-ratio: 4 / 3; width: 100%; border-radius: 10px; } + +/* ------------------------------------------------------------------ home */ +.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 24px 0 12px; } +.hero-title { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; margin-bottom: 20px; } +.grad-text { background: linear-gradient(100deg, var(--brand-teal), #8FA7FF 55%, var(--brand-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; } +:root[data-theme="light"] .grad-text { background: linear-gradient(100deg, #0E7490, #4F46E5 60%, #5B3FE0); -webkit-background-clip: text; background-clip: text; } +.hero-lede { color: var(--text-2); font-size: 1.08rem; max-width: 600px; margin-bottom: 28px; } +.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; } +.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-teal); box-shadow: 0 0 0 0 rgba(34, 211, 238, .6); animation: pulse 2.4s var(--ease-out) infinite; } +@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, .55); } 70% { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); } } + +.hero-visual { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; justify-self: center; } +.hero-visual svg { width: 100%; height: 100%; display: block; overflow: visible; } +.hero-visual::before { + content: ""; position: absolute; inset: 8%; border-radius: 50%; + background: radial-gradient(circle, var(--glow) 0%, transparent 65%); filter: blur(10px); +} +.hg-face { fill: url(#hg-face); stroke: var(--border-strong); stroke-width: .5; } +:root[data-theme="light"] .hg-face { fill: url(#hg-face-light); } +.hg-tick { stroke: #CBD5E1; stroke-linecap: round; opacity: .5; } +.hg-tick.major { opacity: .9; } +.hg-num { fill: #94A3B8; font: 600 5px var(--font-mono); text-anchor: middle; dominant-baseline: middle; } +.hg-readout { fill: var(--text-2); font: 600 4.2px var(--font-mono); letter-spacing: .25em; text-anchor: middle; } +.hg-readout-val { fill: var(--accent-text); font: 700 6px var(--font-mono); text-anchor: middle; letter-spacing: .05em; } +.hg-ring { fill: none; stroke: var(--accent); stroke-width: .6; opacity: 0; } + +.stats { list-style: none; padding: 0; margin: 40px 0 32px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; } +.stat { + background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; + position: relative; overflow: hidden; box-shadow: var(--shadow); +} +.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--brand-teal), var(--brand-violet)); opacity: .7; } +.stat-num { display: block; font: 700 clamp(1.7rem, 1.2rem + 1.4vw, 2.3rem)/1.1 var(--font-mono); letter-spacing: -.02em; margin-bottom: 4px; font-variant-numeric: tabular-nums; } +.stat-label { color: var(--text-2); font-size: .88rem; } +.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; } +.pillar h2 { font-size: 1.02rem; margin-top: 12px; } +.pillar p { color: var(--text-2); font-size: .93rem; margin: 0; } +.pillar-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); } +.finding { display: flex; gap: 24px; align-items: center; justify-content: space-between; background: linear-gradient(120deg, color-mix(in srgb, var(--violet) 12%, var(--surface-solid)), var(--surface)); } +.finding p:last-child { margin: 0; color: var(--text-2); } +.finding h2 { font-size: 1.25rem; } + +/* ------------------------------------------------------------------ factory */ +.controls { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: flex-start; margin-bottom: 20px; } +.controls #profile-ctl { width: 170px; } +.controls .ctl-num { width: 96px; } +.controls .ctl-seed { width: 236px; } +.ctl-go { margin-left: auto; align-self: center; } +.seed-row { display: flex; gap: 6px; } +.seed-row .input { min-width: 0; } +.seed-row .icon-btn { min-height: 40px; min-width: 40px; } +#dice-btn svg { transition: transform 500ms var(--ease-out); } +#dice-btn.rolling svg { transform: rotate(360deg); } + +.pipeline { margin-bottom: 20px; overflow: hidden; } +.pipe-stages { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; position: relative; } +.pipe-stage { position: relative; text-align: center; padding-top: 44px; font-size: .84rem; color: var(--muted); font-weight: 600; transition: color var(--t-ui); } +.pipe-stage::before { + content: ""; position: absolute; top: 19px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; + background: var(--border-strong); +} +.pipe-stage:first-child::before { display: none; } +.pipe-stage::after { + content: ""; position: absolute; top: 19px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; + background: linear-gradient(90deg, var(--brand-teal), var(--brand-violet)); transform: scaleX(0); transform-origin: left; + transition: transform 380ms var(--ease-out); +} +.pipe-stage:first-child::after { display: none; } +.pipe-stage.done::after, .pipe-stage.active::after { transform: scaleX(1); } +.pipe-node { + position: absolute; top: 2px; left: 50%; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%; + display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--bg-2); color: var(--muted); + transition: border-color var(--t-ui), background-color var(--t-ui), color var(--t-ui), box-shadow var(--t-ui); +} +.pipe-node svg { width: 16px; height: 16px; } +.pipe-stage.active { color: var(--text); } +.pipe-stage.active .pipe-node { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent); animation: node-pulse 1s var(--ease-io) infinite; } +.pipe-stage.done { color: var(--text-2); } +.pipe-stage.done .pipe-node { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); } +@keyframes node-pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 6%, transparent); } } +.pipe-gates-title { font: 600 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; } +.gate-lamps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; } +.gate-lamp { + display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border-radius: 999px; + border: 1px solid var(--border); font-size: .8rem; color: var(--muted); background: var(--bg-2); + transition: all 260ms var(--ease-out); +} +.gate-lamp .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: all 260ms var(--ease-out); } +.gate-lamp .gid { font-family: var(--font-mono); font-weight: 700; } +.gate-lamp.lit { color: var(--text); border-color: color-mix(in srgb, var(--pass) 50%, transparent); background: var(--pass-bg); } +.gate-lamp.lit .lamp { background: var(--pass); box-shadow: 0 0 10px var(--pass); } +.gate-lamp.checking .lamp { background: var(--accent); box-shadow: 0 0 10px var(--accent); } + +.run-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 24px; margin: 4px 0 16px; } +.run-pick { min-width: 260px; } +.run-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-2); font-size: .88rem; } +.pill { + display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); + background: var(--surface); font-size: .8rem; color: var(--text-2); min-height: 28px; +} +.pill .mono { color: var(--text); } +.pill button { all: unset; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 4px; color: var(--muted); } +.pill button:hover { color: var(--text); } +.pill button:focus-visible { outline: 2px solid var(--focus); } + +.funnel { display: grid; grid-template-columns: minmax(220px, 1fr) 1.3fr; gap: 24px; margin-bottom: 20px; animation: view-in 400ms var(--ease-out) both; } +.funnel h2 { font-size: .95rem; margin-bottom: 10px; } +.funnel-big { font: 700 2rem/1 var(--font-mono); margin-bottom: 6px; } +.funnel-big small { font-size: .95rem; color: var(--muted); font-weight: 500; } +.funnel-bar { height: 12px; border-radius: 999px; background: var(--fail-bg); overflow: hidden; margin: 12px 0 8px; border: 1px solid var(--border); } +.funnel-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-teal), var(--brand-violet)); border-radius: 999px; transform-origin: left; animation: bar-in 800ms var(--ease-out) both; } +@keyframes bar-in { from { transform: scaleX(0); } } +.rej-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } +.rej-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 28px; gap: 10px; align-items: center; font-size: .84rem; } +.rej-row .rej-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.rej-track { height: 8px; border-radius: 99px; background: var(--skeleton); overflow: hidden; } +.rej-track span { display: block; height: 100%; background: var(--fail); opacity: .8; border-radius: 99px; transform-origin: left; animation: bar-in 700ms var(--ease-out) both; } +.rej-row .mono { text-align: right; } +details.rej-log { margin-top: 12px; font-size: .84rem; } +details.rej-log summary { cursor: pointer; color: var(--accent-text); font-weight: 600; min-height: 24px; } +details.rej-log ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); } +details.rej-log li { margin-bottom: 4px; } + +.task-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; } +.task-card { animation: card-in 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); } +@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } } +.task-btn { + all: unset; box-sizing: border-box; display: flex; flex-direction: column; width: 100%; height: 100%; cursor: pointer; + background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); + transition: transform var(--t-ui) var(--ease-out), border-color var(--t-ui), box-shadow var(--t-ui); +} +.task-btn:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow), 0 16px 40px -20px color-mix(in srgb, var(--accent) 60%, transparent); } +.task-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; } +.task-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--img-bg); overflow: hidden; } +.task-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 400ms var(--ease-out), transform 600ms var(--ease-out); } +.task-thumb img.loaded { opacity: 1; } +.task-btn:hover .task-thumb img { transform: scale(1.03); } +.task-thumb .skeleton { position: absolute; inset: 0; border-radius: 0; } +.task-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; } +.task-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } +.op-badge { + font: 700 .7rem/1 var(--font-mono); letter-spacing: .06em; padding: 5px 7px; border-radius: 6px; + color: var(--violet-text); background: color-mix(in srgb, var(--violet) 14%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 35%, transparent); +} +.diff { display: inline-flex; align-items: center; gap: 3px; font: 600 .72rem var(--font-mono); color: var(--muted); } +.diff i { width: 6px; height: 10px; border-radius: 2px; background: var(--border-strong); display: inline-block; } +.diff i.on { background: var(--accent); } +.twin-badge { font-size: .72rem; color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; } +.task-q { font-size: .88rem; color: var(--text); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; } +.cert-mark { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--pass); font-weight: 600; } +.empty { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); grid-column: 1 / -1; } +.error-box { border: 1px solid color-mix(in srgb, var(--fail) 50%, transparent); background: var(--fail-bg); color: var(--text); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } +.error-box strong { color: var(--fail-text); } + +/* ------------------------------------------------------------------ inspector drawer */ +.drawer-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 80; backdrop-filter: blur(3px); animation: fade-in 220ms var(--ease-out); } +@keyframes fade-in { from { opacity: 0; } } +.drawer { + position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(1180px, 96vw); + background: var(--bg); border-left: 1px solid var(--border-strong); box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .6); + display: flex; flex-direction: column; animation: drawer-in 340ms var(--ease-out); + background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); + background-size: 32px 32px; +} +@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } } +.drawer.closing { animation: drawer-out 200ms var(--ease-io) forwards; } +@keyframes drawer-out { to { transform: translateX(40px); opacity: 0; } } +.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); } +.drawer-title-wrap { min-width: 0; } +.drawer-head .eyebrow { margin-bottom: 2px; } +.drawer-head h2 { margin: 0; font-size: 1.05rem; font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.drawer-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; } +.kbd-hint { color: var(--muted); font-size: .76rem; margin-right: 8px; display: inline-flex; gap: 3px; align-items: center; } +.insp-pos { font: 600 .8rem var(--font-mono); color: var(--muted); min-width: 52px; text-align: center; } +.drawer-body { flex: 1; overflow-y: auto; padding: 20px; overscroll-behavior: contain; } +.insp-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); gap: 20px; align-items: start; animation: view-in 300ms var(--ease-out) both; } +.insp-main, .insp-side { display: grid; gap: 16px; min-width: 0; } +.figure-card { padding: 12px; } +.figure-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; } +.figure-toolbar .hint { margin: 0; } +.proof-stage { position: relative; border-radius: 10px; overflow: hidden; background: var(--img-bg); aspect-ratio: 4 / 3; } +.proof-stage img { display: block; width: 100%; height: 100%; object-fit: contain; } +.proof-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; } +.verdicts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; } +.verdict { + display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: .86rem; + border: 1px solid var(--border); background: var(--surface-2); animation: view-in 300ms var(--ease-out) both; +} +.verdict.ok { border-color: color-mix(in srgb, var(--pass) 45%, transparent); background: var(--pass-bg); } +.verdict.bad { border-color: color-mix(in srgb, var(--fail) 50%, transparent); background: var(--fail-bg); } +.verdict .mono { font-weight: 600; } +.vi { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; } +.ok .vi, .pass .vi { color: var(--pass); } +.bad .vi, .fail .vi { color: var(--fail); } +.proof-off-note { color: var(--muted); font-size: .84rem; margin: 10px 0 0; } + +/* proof overlay shapes (image pixel space) */ +.pf-target { fill: rgba(34, 211, 238, .07); stroke: #22D3EE; stroke-width: 2; stroke-dasharray: 8 6; } +.pf-target-label rect { fill: #22D3EE; } +.pf-target-label text { fill: #04212A; font: 700 15px var(--font-mono); } +.pf-face { fill: none; stroke: #A895FF; stroke-width: 3.5; } +.pf-tick { fill: #F8FAFC; stroke: #7C5CFF; stroke-width: 2; } +.pf-ocr { fill: rgba(124, 92, 255, .12); stroke: #A895FF; stroke-width: 1.5; } +.pf-ocr-text { fill: #F8FAFC; font: 700 12px var(--font-mono); paint-order: stroke; stroke: #1E1B4B; stroke-width: 3px; stroke-linejoin: round; } +.pf-needle { stroke: #22D3EE; stroke-width: 6; stroke-linecap: round; fill: none; filter: drop-shadow(0 0 4px rgba(34, 211, 238, .9)); } +.pf-trace { stroke: #22D3EE; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; fill: none; filter: drop-shadow(0 0 4px rgba(34, 211, 238, .9)); } +.pf-trace-head { fill: #22D3EE; stroke: #04212A; stroke-width: 2; } +.pf-anim { transform-box: fill-box; transform-origin: center; opacity: 0; animation: pf-fade 420ms var(--ease-out) forwards; animation-delay: var(--d, 0ms); } +@keyframes pf-fade { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } } +.pf-anim-dot { transform-box: fill-box; transform-origin: center; } +.pf-draw { animation: pf-draw var(--dur, 900ms) var(--ease-out) forwards; animation-delay: var(--d, 0ms); } +@keyframes pf-draw { to { stroke-dashoffset: 0; } } + +.q-card h3 { font-size: .78rem; font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; } +.q-text { font-size: 1.05rem; line-height: 1.5; margin-bottom: 14px; } +.answer-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } +.answer-val { font: 700 1.2rem var(--font-mono); padding: 8px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); animation: reveal 420ms var(--ease-out) both; } +@keyframes reveal { from { opacity: 0; transform: translateY(6px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } } + +.cert-card h3 { display: flex; align-items: center; gap: 8px; font-size: .98rem; } +.cert-seal { width: 22px; height: 22px; color: var(--pass); } +.gate-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 4px; } +.gate-row { display: grid; grid-template-columns: 22px auto 1fr; gap: 4px 10px; align-items: start; padding: 7px 10px; border-radius: 8px; font-size: .84rem; border: 1px solid transparent; transition: background-color 200ms, border-color 200ms; } +.gate-row .vi { width: 18px; height: 18px; } +.gate-row .g-id { font: 700 .74rem var(--font-mono); color: var(--muted); padding-top: 2px; } +.gate-row .g-label { font-weight: 600; } +.gate-row .g-state { font: 700 .7rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; margin-left: 6px; } +.gate-row.pass .g-state { color: var(--pass); } +.gate-row.fail .g-state { color: var(--fail-text); } +.gate-row .g-detail { grid-column: 3; color: var(--muted); font-size: .8rem; font-family: var(--font-mono); word-break: break-word; } +.gate-row.fail { background: var(--fail-bg); border-color: color-mix(in srgb, var(--fail) 45%, transparent); } +.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0 0 14px; font-size: .84rem; align-items: center; } +.kv dt { color: var(--muted); } +.kv dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; font-family: var(--font-mono); } +.kv dd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.copy-btn { min-width: 28px; min-height: 28px; padding: 4px; } +.trace-details { margin: 0 0 14px; } +.trace-list { margin: 8px 0 0; padding-left: 22px; font: .84rem var(--font-mono); color: var(--text-2); } +.sig-chips { display: flex; flex-wrap: wrap; gap: 6px; } +.sig-chip { font: .74rem var(--font-mono); padding: 4px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); } +.sig-chip b { color: var(--text); font-weight: 600; } +.sub-h { font: 600 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; } + +.twin-card h3 { font-size: .98rem; } +.twin-stage { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--img-bg); --wipe: 50%; } +.twin-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; } +.twin-stage .twin-top { clip-path: inset(0 0 0 var(--wipe)); } +.twin-divider { position: absolute; top: 0; bottom: 0; left: var(--wipe); width: 2px; margin-left: -1px; background: var(--brand-teal); box-shadow: 0 0 12px var(--brand-teal); pointer-events: none; } +.twin-divider::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: var(--brand-teal); color: #04212A; display: grid; place-items: center; font-size: 14px; font-weight: 700; } +.twin-labels { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; pointer-events: none; } +.twin-labels span { font: 700 .7rem var(--font-mono); padding: 3px 7px; border-radius: 5px; background: rgba(11, 18, 32, .8); color: #F8FAFC; } +.twin-range { width: 100%; margin: 12px 0 6px; accent-color: var(--accent); min-height: 24px; } +.twin-cap { font-size: .84rem; color: var(--text-2); margin: 0; } + +/* ------------------------------------------------------------------ lab */ +.fault-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; } +.fault-btn { + all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; + padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); + transition: transform var(--t-ui) var(--ease-out), border-color var(--t-ui), background-color var(--t-ui); + animation: card-in 500ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); +} +.fault-btn:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); } +.fault-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; } +.fault-btn[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); } +.fault-btn .f-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; } +.fault-btn .f-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--violet-text); background: color-mix(in srgb, var(--violet) 12%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent); } +.fault-btn .f-gate { font: 700 .7rem var(--font-mono); color: var(--muted); } +.fault-btn h2 { font-size: 1rem; margin: 4px 0 0; } +.fault-btn p { font-size: .86rem; color: var(--text-2); margin: 0; } +.fault-btn .f-cta { margin-top: auto; font-size: .8rem; font-weight: 650; color: var(--accent-text); padding-top: 6px; } +.lab-stage { scroll-margin-top: 84px; margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); gap: 20px; animation: view-in 360ms var(--ease-out) both; } +.lab-images { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; } +.lab-img figure { margin: 0; } +.lab-img figcaption { font-size: .8rem; font-weight: 650; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; } +.lab-img .frame { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--img-bg); border: 1px solid var(--border); position: relative; } +.lab-img .frame img { width: 100%; height: 100%; object-fit: contain; display: block; } +.lab-img.defect .frame { border-color: color-mix(in srgb, var(--fail) 55%, transparent); } +.lab-q { grid-column: 1 / -1; font-size: .88rem; color: var(--text-2); margin: 4px 0 0; } +.lab-gates { position: relative; } +.lab-gates .gate-row { opacity: .45; } +.lab-gates .gate-row.checked { opacity: 1; } +.lab-gates .gate-row.scanning { opacity: 1; background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); } +.lab-gates .gate-row.pending .vi { color: var(--muted); } +.stamp { + margin-top: 14px; display: inline-flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-radius: 10px; + border: 3px solid var(--fail); color: var(--fail-text); transform: rotate(-4deg); + font: 800 1rem/1.2 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; + background: var(--fail-bg); animation: stamp 520ms cubic-bezier(.2, 1.6, .4, 1) both; + box-shadow: 0 0 0 1px color-mix(in srgb, var(--fail) 25%, transparent) inset; +} +.stamp small { font-size: .72rem; font-weight: 700; letter-spacing: .08em; opacity: .9; } +@keyframes stamp { 0% { opacity: 0; transform: rotate(-12deg) scale(1.8); } 60% { opacity: 1; transform: rotate(-3deg) scale(.95); } 100% { transform: rotate(-4deg) scale(1); } } +.stamp.missed { border-color: var(--muted); color: var(--text-2); background: var(--surface-2); } +.recall-card h2 { margin-bottom: 4px; } + +/* ------------------------------------------------------------------ tables */ +.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); } +table.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; } +.tbl caption { text-align: left; padding: 0 0 8px; color: var(--muted); font-size: .8rem; } +.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; } +.tbl thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; background: var(--surface-2); position: sticky; top: 0; } +.tbl tbody tr:last-child td, .tbl tbody tr:last-child th { border-bottom: 0; } +.tbl tbody tr:hover { background: var(--surface-hover); } +.tbl td.num, .tbl th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; } +.tbl tfoot td, .tbl tfoot th { font-weight: 700; border-top: 1px solid var(--border-strong); border-bottom: 0; } +.status-pass { color: var(--pass); font-weight: 650; display: inline-flex; gap: 6px; align-items: center; } +.status-pass .vi, .status-fail .vi { width: 16px; height: 16px; } +.status-fail { color: var(--fail-text); font-weight: 650; display: inline-flex; gap: 6px; align-items: center; } +.basis { font: 600 .72rem var(--font-mono); padding: 3px 7px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap; } +.basis.measured { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); } +.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: baseline; flex-shrink: 0; } + +/* ------------------------------------------------------------------ capability map */ +.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } +.chart-card { min-width: 0; animation: card-in 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); } +.chart-card.span-2 { grid-column: 1 / -1; } +.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; } +.chart-head h2 { margin: 0 0 2px; } +.chart-head p { margin: 0; color: var(--muted); font-size: .84rem; max-width: 620px; } +.chart-body { position: relative; } +.chart-svg { width: 100%; height: auto; display: block; overflow: visible; } +.chart-svg text { font-family: var(--font-ui); fill: var(--text-2); font-size: 12px; } +.chart-svg .axis-label { fill: var(--muted); font-size: 11px; } +.chart-svg .tick-label { fill: var(--muted); font-size: 11px; font-family: var(--font-mono); } +.chart-svg .grid { stroke: var(--border); stroke-width: 1; } +.chart-svg .axis { stroke: var(--border-strong); stroke-width: 1; } +.chart-svg .direct-label { fill: var(--text); font-size: 12px; font-weight: 600; } +.chart-svg .direct-val { fill: var(--text-2); font-size: 11px; font-family: var(--font-mono); } +.chart-svg .series-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; } +.chart-svg .pt { stroke: var(--bg-2); stroke-width: 2; cursor: pointer; transition: r 150ms var(--ease-out); } +.chart-svg .pt:focus { outline: none; } +.chart-svg .pt:focus-visible, .chart-svg .pt.hot { stroke: var(--text); stroke-width: 3; } +.chart-svg .frontier { stroke: var(--muted); stroke-dasharray: 5 5; fill: none; stroke-width: 1.5; } +.chart-svg .ci { stroke-width: 2; stroke-linecap: round; opacity: .75; } +.chart-svg .annot { fill: var(--muted); font-size: 11px; font-style: italic; } +.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; margin: 0 0 10px; font-size: .8rem; color: var(--text-2); } +.legend li { display: inline-flex; align-items: center; } +.legend .swatch { width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; } + +.heat-scroll { position: relative; overflow-x: auto; padding: 4px; } +.heat { display: grid; gap: 3px; font-size: .8rem; --heat-rh: 118px; --heat-col: 52px; } +.heat-row { display: contents; } +.heat-colhead { font: 600 .72rem var(--font-ui); color: var(--text-2); padding: 4px 2px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 5px; line-height: 1.2; word-break: break-word; } +.heat-colhead .swatch { margin: 0; width: 18px; height: 4px; } +.heat-rowhead { font: 600 .78rem var(--font-mono); color: var(--text-2); display: flex; align-items: center; padding-right: 8px; white-space: nowrap; } +.heat-rowhead small { color: var(--muted); font-weight: 500; margin-right: 4px; } +.heat-cell { + border-radius: 6px; min-height: 36px; display: grid; place-items: center; font: 700 .82rem var(--font-mono); + cursor: default; transition: transform 150ms var(--ease-out), box-shadow 150ms; position: relative; border: 1px solid transparent; + animation: fade-in 500ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 12ms); +} +.heat-cell:hover, .heat-cell:focus-visible { transform: scale(1.06); z-index: 2; box-shadow: 0 0 0 2px var(--focus); outline: none; } +.heat-cell.na { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); font-weight: 500; } +.heat-scale { display: flex; align-items: center; gap: 10px; margin-top: 12px; font: .74rem var(--font-mono); color: var(--muted); } +.heat-scale .bar { flex: 0 1 220px; height: 8px; border-radius: 99px; } +.tooltip { + position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; max-width: min(280px, calc(100vw - 16px)); visibility: hidden; + background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; + padding: 8px 11px; font-size: .8rem; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); + opacity: 0; transform: translateY(4px); transition: opacity 120ms var(--ease-out), transform 120ms var(--ease-out); +} +.tooltip.show { opacity: 1; transform: none; visibility: visible; } +.tooltip b { font-family: var(--font-mono); } +.tooltip .tt-sub { color: var(--muted); font-size: .76rem; } +.fail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px 24px; } +.fail-model h3 { font-size: .9rem; display: flex; align-items: center; margin-bottom: 8px; } +.fail-model h3 small { color: var(--muted); font-weight: 500; margin-left: auto; font-size: .76rem; } +.fbar { display: grid; grid-template-columns: 1fr 32px; gap: 2px 8px; align-items: center; margin-bottom: 6px; font-size: .78rem; } +.fbar .fl { grid-column: 1 / -1; color: var(--text-2); display: flex; gap: 6px; } +.fbar .fl .mono { color: var(--text); font-weight: 600; font-size: .74rem; } +.fbar .ft { height: 8px; border-radius: 99px; background: var(--skeleton); overflow: hidden; } +.fbar .ft span { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: bar-in 800ms var(--ease-out) both; } +.fbar .fv { font: 600 .78rem var(--font-mono); text-align: right; } +.stat-rows { display: grid; gap: 10px; } +.srow { display: grid; grid-template-columns: minmax(130px, 170px) 1fr 120px; gap: 12px; align-items: center; font-size: .84rem; } +.srow .sm { display: flex; align-items: center; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.srow .strack { height: 10px; background: var(--skeleton); border-radius: 99px; position: relative; overflow: visible; } +.srow .strack span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transform-origin: left; animation: bar-in 800ms var(--ease-out) both; } +.srow .strack .ci-band { position: absolute; top: -3px; bottom: -3px; border-left: 2px solid var(--text-2); border-right: 2px solid var(--text-2); opacity: .5; } +.srow .sv { font: 600 .82rem var(--font-mono); text-align: right; } +.mini-h { font: 600 .78rem var(--font-ui); color: var(--text); margin: 4px 0 10px; } +.mini-note { font-size: .8rem; color: var(--muted); margin: 10px 0 0; } +.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; } +.table-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--text); } + +/* ------------------------------------------------------------------ ship */ +.ship-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; } +.ship-side { display: grid; gap: 16px; min-width: 0; } +.estimator { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; } +.est-result, .export-card, .code-card { min-width: 0; } +.estimator h2 { margin: 0; } +.est-n-row { display: grid; grid-template-columns: 1fr 140px; gap: 12px; align-items: center; } +input[type="range"] { accent-color: var(--accent); width: 100%; min-height: 24px; cursor: pointer; } +.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; } +.check { + display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); + background: var(--bg-2); cursor: pointer; font-size: .86rem; min-height: 40px; transition: border-color var(--t-fast), background-color var(--t-fast); +} +.check:hover { border-color: var(--border-strong); } +.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; } +.check:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); } +.check .prov { margin-left: auto; color: var(--muted); font-size: .74rem; font-family: var(--font-mono); } +.est-opts { display: flex; gap: 28px; flex-wrap: wrap; align-items: start; } +.est-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; } +.est-total .big { font: 700 2rem/1 var(--font-mono); letter-spacing: -.02em; } +.est-total .gen { font-size: .84rem; color: var(--text-2); } +.export-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; } +.export-card .select-wrap { margin-top: 8px; } +.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; } +.code-head h2 { margin: 0; } +.code-wrap { position: relative; } +pre.code { + margin: 0; padding: 14px 16px; padding-right: 72px; border-radius: 10px; background: #060A13; color: #D6E2F2; + border: 1px solid var(--border-strong); font-size: .8rem; line-height: 1.6; overflow-x: auto; white-space: pre; +} +pre.code .c-k { color: #5EE3F5; } +pre.code .c-s { color: #C4B5FD; } +pre.code .c-m { color: #8C9AB0; } +.copy-code { position: absolute; top: 8px; right: 8px; } + +/* ------------------------------------------------------------------ how it works */ +.diagram-card { margin: 0 0 16px; padding: 24px; } +.how-diagram svg { width: 100%; height: auto; display: block; } +.dg-node rect { fill: var(--surface-solid); stroke: var(--border-strong); stroke-width: 1.2; } +.dg-node.key rect { stroke: var(--accent); stroke-width: 1.6; } +.dg-node text { fill: var(--text); font: 650 13px var(--font-ui); text-anchor: middle; } +.dg-node .dg-sub { fill: var(--muted); font: 500 10.5px var(--font-mono); } +.dg-node .dg-num { fill: var(--accent-text); font: 700 10px var(--font-mono); text-anchor: start; } +.dg-edge { fill: none; stroke: var(--border-strong); stroke-width: 1.6; } +.dg-flow { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 10; animation: flow 1.2s linear infinite; opacity: .85; } +@keyframes flow { to { stroke-dashoffset: -28; } } +.dg-reject { fill: none; stroke: var(--fail); stroke-width: 1.4; stroke-dasharray: 3 4; } +.dg-reject-text { fill: var(--fail-text); font: 600 11px var(--font-mono); } +.dg-arrow { fill: var(--border-strong); } +.how-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; } +.how-card p { color: var(--text-2); font-size: .93rem; margin: 0; } + +/* ------------------------------------------------------------------ toast & footer */ +.toast { + position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 300; opacity: 0; pointer-events: none; + background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px; + padding: 8px 16px; font-size: .86rem; font-weight: 600; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); + transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); +} +.toast.show { opacity: 1; transform: translate(-50%, 0); } +.footer { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); } +.footer-inner { max-width: 1240px; margin: 0 auto; padding: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: .84rem; } +.footer-inner p { margin: 0; } +.footer-links { margin-left: auto !important; } +.footer-mark { border-radius: 7px; } + +/* ------------------------------------------------------------------ responsive */ +@media (max-width: 1100px) { + .insp-grid { grid-template-columns: minmax(0, 1fr); } + .kbd-hint { display: none; } +} +@media (max-width: 900px) { + .hero { grid-template-columns: 1fr; gap: 16px; } + .hero-visual { max-width: 340px; order: -1; } + .stats { grid-template-columns: repeat(2, 1fr); } + .pillars { grid-template-columns: 1fr; } + .finding { flex-direction: column; align-items: flex-start; } + .map-grid { grid-template-columns: minmax(0, 1fr); } + .chart-card.span-2 { grid-column: auto; } + .ship-grid { grid-template-columns: minmax(0, 1fr); } + .fault-grid { grid-template-columns: repeat(2, 1fr); } + .lab-stage { grid-template-columns: minmax(0, 1fr); } + .funnel { grid-template-columns: 1fr; } + .how-grid { grid-template-columns: 1fr; } + .two-col { grid-template-columns: 1fr; } + .nav-toggle { display: inline-flex; } + .primary-nav { + position: absolute; top: 100%; left: 0; right: 0; margin: 0; padding: 8px 12px 14px; + background: var(--bg); border-bottom: 1px solid var(--border); display: none; + } + .primary-nav.open { display: block; animation: view-in 200ms var(--ease-out); } + .primary-nav ul { flex-direction: column; } + .primary-nav a { padding: 12px; } + .primary-nav a[aria-current="page"]::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; } + .topbar-inner { position: relative; } + .theme-toggle-label { display: none; } +} +@media (max-width: 640px) { + main { padding: 20px 16px 48px; } + .topbar-inner { padding: 8px 16px; gap: 8px; } + .brand-studio { display: none; } + .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } + .controls #profile-ctl, .controls .ctl-num, .controls .ctl-seed { width: auto; } + .controls .ctl-wide, .controls .ctl-seed, .controls .ctl-go, .controls > fieldset:first-child { grid-column: 1 / -1; } + .controls #profile-ctl { order: 1; } + .controls .ctl-wide { order: 0; } + .controls .ctl-num { order: 1; } + .controls .ctl-seed { order: 2; } + .controls .ctl-go { order: 3; } + .ctl-go { margin-left: 0; } + .ctl-go .btn { width: 100%; } + .fault-grid { grid-template-columns: 1fr; } + .lab-images { grid-template-columns: 1fr; } + .stats { gap: 10px; } + .stat { padding: 14px; } + .drawer { width: 100vw; border-left: 0; } + .drawer-head { padding: 10px 12px; } + .drawer-body { padding: 12px; } + .insp-pos { display: none; } + .run-pick { min-width: 0; width: 100%; } + .srow { grid-template-columns: 1fr 70px; } + .srow .strack { grid-column: 1 / -1; grid-row: 2; } + .est-n-row { grid-template-columns: 1fr; } + .rej-row { grid-template-columns: 1fr 28px; } + .rej-row .rej-track { grid-column: 1 / -1; grid-row: 2; } + .card { padding: 16px; } + .heat { --heat-rh: 92px; --heat-col: 42px; gap: 2px; } + .heat-rowhead small { display: none; } + .heat-rowhead { font-size: .72rem; padding-right: 4px; } + .heat-cell { font-size: .74rem; min-height: 32px; } + .heat-colhead { font-size: .66rem; } + .footer-links { margin-left: 0 !important; } + .hero-ctas .btn { width: 100%; } +} +@media (max-width: 380px) { + .stats { grid-template-columns: 1fr; } + .brand-wordmark { height: 24px; } +} + +/* ------------------------------------------------------------------ reduced motion */ +@media (prefers-reduced-motion: reduce) { + html { scroll-behavior: auto; } + *, *::before, *::after { + animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; + transition-duration: 1ms !important; transition-delay: 0ms !important; + } + .skeleton { animation: none; } + .dg-flow { display: none; } +} +:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after { + animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; + transition-duration: 1ms !important; transition-delay: 0ms !important; +} +:root.reduce-motion .dg-flow { display: none; } + +@media (forced-colors: active) { + .heat-cell { border: 1px solid CanvasText; } + .btn-primary { border: 1px solid ButtonText; } +}