Seal independent proper poses and block uncorrected blind-package release

This commit is contained in:
Frank14f committed 2026-11-14 19:57:58 +08:00
1 parent 6d61c08686
commit 039d4c490f
20 files changed
+452 -4

No files matched your search

@@ -0,0 +1,18 @@
{
"ruling": "https://arcticnimbus.slack.com/archives/C0C78UFKGRM/p1794656217775229",
"scope": "presentation correction only; stored PLY input, no original geometry queue restart or archive reads",
"exports": 240,
"source_sha256": {
"tools/run_g1_blind_pose.py": "8ebb96b9454d27866db10d4e4834f8fa17d2c288993ca4489f868184391f6c80",
"tools/pose_g1_blind_surface.py": "3f0f1407d226800d66862c1beb1b113c431afc40e4e8e57bd278eb4d70d3b9c6",
"tools/g1_blind_pose.py": "857abbf3032c8eba4b14cbf22c8b6a03c80072a05704601c5ef5fbeade764756",
"tools/render_g1_blind_surface.py": "98a82a9ad8269ac44a51c6c8602db80528534c7fee8494626bf93c177ed17d81",
"tools/g1_blind_geometry.py": "9f8303264231fd16f011817998758bd9c9221e6488a4b87a16e8b5e719e0845c",
"tools/s2_e1_supervisor.py": "6753c9ceb0b932047ba505bd15681f109e9407bdb58fd96c55e1431a3f1b4a02"
},
"pose_plan_sha256": "52f917f7864fa8187063c5b0cbb6e3c9cfab0299b5dfe9e6485fc04621668c20",
"sampling_mapping_sha256": "3a9495efad4196763713c20f8b9158d86fce3fb60409242208b67bcb481e37f9",
"poll_target_seconds": 0.1,
"limits": "existing8 CPU-h/8 GiB geometry preparation phase; E1 cumulative16 CPU-h/25 GiB; sequential; each30min/1.25GiB treeRSS; no retries",
"numerical_invariants": "detR=+1 and R^TR=I within1e-12; edge and double-area absolute error normalized by original bbox diagonal and its square <=1e-10; not a scientific similarity threshold"
}
@@ -0,0 +1,23 @@
{
"version": 2,
"supersedes": "unposed package contract preserved under preparation/superseded-unposed",
"required_before_build": [
"232 original extraction receipts PASS",
"240 corrected export receipts PASS",
"original sampling seals unchanged",
"pose plan and full final mapping match published pose-seals"
],
"source_sha256": {
"tools/build_g1_blind120_package.py": "e809eef4d6d0eac6de63c0a31692fc6762408b33edd7c6e7d34e9d813acb660b",
"tools/g1_blind_geometry.py": "9f8303264231fd16f011817998758bd9c9221e6488a4b87a16e8b5e719e0845c",
"tools/s2_e1_supervisor.py": "6753c9ceb0b932047ba505bd15681f109e9407bdb58fd96c55e1431a3f1b4a02"
},
"limits": {
"cpu_seconds": 1800,
"wall_seconds": 1800,
"tree_rss_bytes": 1342177280,
"stage_disk_bytes": 8589934592
},
"reviewer_attestation": "unsigned template included; signed with frozen labels before unblinding",
"post_test_template_only_change": "Added links to attestation in HTML/Markdown index; no geometry/seal logic change"
}
@@ -0,0 +1,11 @@
{
"pose_plan_sha256": "52f917f7864fa8187063c5b0cbb6e3c9cfab0299b5dfe9e6485fc04621668c20",
"sampling_mapping_sha256_unchanged": "3a9495efad4196763713c20f8b9158d86fce3fb60409242208b67bcb481e37f9",
"exports": 240,
"test_result": "4/4 synthetic proper rotation, scale rejection, inverse, seed-child stability and mirror parity checks pass",
"test_runner_wall_seconds": 0.03,
"test_source_sha256": "7fadabaa6c1d7e0a84a2c512236c6e3942d3501e948bf38c9426143a95045643",
"renderer_source_unchanged": true,
"e1_charged_before_pose": 3464.0792120000015,
"no_original_archive_read": true
}
@@ -0,0 +1,10 @@
{
"tests": 4,
"passed": 4,
"unit_test_runner_seconds": 0.03,
"measurement_scope": "unittest reported time; process CPU not separately measured",
"source_sha256": {
"tools/g1_blind_pose.py": "857abbf3032c8eba4b14cbf22c8b6a03c80072a05704601c5ef5fbeade764756",
"tools/test_g1_blind_pose.py": "7fadabaa6c1d7e0a84a2c512236c6e3942d3501e948bf38c9426143a95045643"
}
}
@@ -0,0 +1,10 @@
{
"returncode": 0,
"cpu_seconds": 1.243478,
"wall_seconds": 1.246909256966319,
"scope": "synthetic120-pair fixture, unposed-release blocked, pose seal tamper rejected, unsigned attestation present",
"code_sha256": {
"tools/build_g1_blind120_package.py": "5f131aa459a6fdc1ceb6e0b32308de435a1f5cfb9636c44ceb1df8f5debec1c5",
"tools/test_g1_blind_package.py": "e88e61e59c3417a36702a453293d873af911a7be77f7ad7229f0b44cfb90f210"
}
}
@@ -0,0 +1,7 @@
test_unposed_package_blocked (test_g1_blind_package.PackageTest) ... ok
test_whole_synthetic_package_and_blank_labels (test_g1_blind_package.PackageTest) ... ok
----------------------------------------------------------------------
Ran 2 tests in 0.851s
OK
@@ -0,0 +1,56 @@
"""Package completed anonymous surfaces/views; identity mapping stays sealed."""
from pathlib import Path
import csv,hashlib,json,os,shutil,sys,time,resource
from zipfile import ZipFile,ZipInfo,ZIP_DEFLATED
from g1_blind_geometry import UNITS,validate_pair
ROOT=Path('artifacts/s2-g1-blind120-2026-11-14')
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
def main():
start=time.monotonic();done=json.loads((ROOT/'custodian/batch-complete.json').read_text());assert done['all_pass'] and done['parts']==232
mapping=json.loads((ROOT/'custodian/sampling-and-mapping.json').read_text());public=json.loads((ROOT/'public/sample-summary-and-seals.json').read_text())
assert len(mapping['pairs'])==120 and len({r['anonymous_pair_id'] for r in mapping['pairs']})==120
assert len(mapping['unique_cases'])==232 and {r[k] for r in mapping['pairs'] for k in ['a','b']}==set(mapping['unique_cases'])
assert len({tuple(sorted((r['a'],r['b']))) for r in mapping['pairs']})==120
for record in public['sealed_files']:
assert sha(ROOT/'custodian'/record['file'])==record['sha256'], 'Sealed custody input changed'
seal=next(r['sha256'] for r in public['sealed_files'] if r['file']=='sampling-and-mapping.json');assert sha(ROOT/'custodian/sampling-and-mapping.json')==seal
bundle=ROOT/'blind-package';bundle.mkdir(exist_ok=False);ids=[];records=[]
for row in mapping['pairs']:
pid=row['anonymous_pair_id'];ids.append(pid);pair=bundle/'pairs'/pid;views=bundle/'views'/pid;pair.mkdir(parents=True);views.mkdir(parents=True)
for side in ['left','right']:
case=row[side];asset=hashlib.sha256(bytes.fromhex(mapping['anonymous_id_secret_hex'])+b'asset\0'+case.encode()).hexdigest()[:32];src=ROOT/'custodian/geometry'/asset
receipt=json.loads((src/'receipt.json').read_text())
for record in receipt['files']:
p=src/record['name'];assert p.stat().st_size==record['bytes'] and sha(p)==record['sha256']
shutil.copyfile(src/'surface.ply',pair/f'{side}.ply')
for name in ['overview','detail-grid']:shutil.copyfile(src/f'{name}.png',views/f'{side}-{name}.png')
(pair/'units.txt').write_text(UNITS)
files=[{'name':p.name,'bytes':p.stat().st_size,'sha256':sha(p)} for p in sorted(pair.iterdir())]
(pair/'manifest.json').write_text(json.dumps({'format':'blind-surface-pair-v1','anonymous_pair_id':pid,'files':files},indent=2)+'\n');validate_pair(pair)
print(json.dumps({'packaged_pairs':len(ids)}),flush=True) if len(ids)%20==0 else None
pages=bundle/'review-pairs';pages.mkdir()
for pid in ids:
(pages/(pid+'.md')).write_text(f'# Anonymous pair {pid}\n\nRelation: unassigned. Record local evidence or unresolved. Original coordinate units; compare axes, not pixel size.\n\n![Left overview](../views/{pid}/left-overview.png)\n\n![Right overview](../views/{pid}/right-overview.png)\n\n![Left fixed detail grid](../views/{pid}/left-detail-grid.png)\n\n![Right fixed detail grid](../views/{pid}/right-detail-grid.png)\n\n[Left full surface](../pairs/{pid}/left.ply) · [Right full surface](../pairs/{pid}/right.ply)\n')
(bundle/'review-index.md').write_text('# Anonymous review index\n\nAll labels are blank. Full instructions: [README](README.md).\n\n'+'\n'.join(f'- [Pair {i+1}: {pid}](review-pairs/{pid}.md)' for i,pid in enumerate(ids))+'\n')
with (bundle/'blank-review.csv').open('w') as f:
w=csv.writer(f,lineterminator='\n');w.writerow(['anonymous_pair_id','relation','local_evidence','resolvable','unresolved_reason','reviewer','review_version'])
for pid in ids:w.writerow([pid,'','','','','',''])
(bundle/'README.md').write_text('''# Geometry-only blind review\n\n120 anonymous pairs. Every relation is unassigned. Do not infer a positive relation from inclusion. Use rigid / template / variant / unrelated / unresolved, and record local geometric evidence. A shared-parent claim requiring source provenance can remain unresolved; no provenance is supplied in this blind view.\n\nOpen index.html locally for uniform views and detail grids; original surface files are in pairs/. Each surface preserves all boundary triangles and original coordinate values. No registration, rescaling or simplification was applied. Source VTU has no explicit physical-unit tag, so axes are original numerical coordinate units, not a universal mm declaration. Views center the object for display only. Separate views fit their own extents; compare numeric axes rather than pixel size.\n\nFour overview views (XY/XZ/YZ/oblique) and four fixed oblique quadrant crops are supplied. Crops are systematic, not certified hole/bridge detections. Edge-on projections may be narrow; rasterization can show tessellation/antialias marks. A dark/white pixel is not topology evidence. Full PLY surface is authoritative; if a relation or local hole/bridge is unresolved, say so and request a zoom by anonymous ID.\n\nNo source key, identities, ranks, residuals, process settings, fields or reference labels are included. blank-review.csv is empty by design. Freeze and commit completed blind labels before the prescribed witnessed unblinding.\n''')
html='''<!doctype html><html lang="zh"><meta charset="utf-8"><title>匿名几何复核</title><style>body{font:16px system-ui;margin:24px;background:#f4f5f7;color:#152333}header{position:sticky;top:0;background:#fff;padding:12px;z-index:2}button,select{font:inherit;margin:4px;padding:8px}main{display:grid;grid-template-columns:1fr 1fr;gap:12px}img{width:100%;background:white;cursor:zoom-in}a{color:#17698b}.note{max-width:1000px;line-height:1.5}dialog{width:95vw;height:95vh}dialog img{width:auto;max-width:none}</style><header><button onclick="move(-1)">上一对</button><select id="which" onchange="show(this.selectedIndex)"></select><button onclick="move(1)">下一对</button><select id="mode" onchange="show(i)"><option value="overview">统一视图</option><option value="detail-grid">固定分区细节</option></select><span id="counter"></span></header><p class="note">仅凭几何填写关系与局部依据。图轴为原坐标单位;分别自适应显示,像素尺寸不能直接比较。点击图片放大。看不清的关系、孔或薄桥可记未决。<a href="blank-review.csv">下载空白判定表</a> · <a href="README.md">完整性说明</a></p><h3 id="label"></h3><main><section><h3>左件 <a id="leftmesh">完整表面</a></h3><img id="left" onclick="zoom(this.src)"></section><section><h3>右件 <a id="rightmesh">完整表面</a></h3><img id="right" onclick="zoom(this.src)"></section></main><dialog id="zoom"><button onclick="document.getElementById('zoom').close()">关闭</button><div><img id="large"></div></dialog><script>const ids=IDS;let i=0;const w=document.getElementById('which');ids.forEach((x,n)=>{const o=document.createElement('option');o.textContent=String(n+1);w.appendChild(o)});function show(n){i=(n+ids.length)%ids.length;w.selectedIndex=i;const id=ids[i],m=document.getElementById('mode').value;document.getElementById('label').textContent=id;document.getElementById('counter').textContent=`${i+1} / ${ids.length}`;for(const s of ['left','right']){document.getElementById(s).src=`views/${id}/${s}-${m}.png`;document.getElementById(s+'mesh').href=`pairs/${id}/${s}.ply`}}function move(d){show(i+d)}function zoom(src){document.getElementById('large').src=src;document.getElementById('zoom').showModal()}show(0);</script></html>'''
(bundle/'index.html').write_text(html.replace('IDS',json.dumps(ids)))
for p in sorted(bundle.rglob('*')):
if p.is_file():records.append({'path':str(p.relative_to(bundle)),'bytes':p.stat().st_size,'sha256':sha(p)})
(bundle/'manifest.json').write_text(json.dumps({'scope':'anonymous geometry and blank review only','pairs':120,'files':records},indent=2)+'\n')
archive=ROOT/'blind-package.zip'
with ZipFile(archive,'x',compression=ZIP_DEFLATED,compresslevel=6) as z:
for p in sorted(bundle.rglob('*')):
if p.is_file():
info=ZipInfo(str(p.relative_to(bundle)),date_time=(1980,1,1,0,0,0));info.external_attr=0o100644<<16;info.compress_type=ZIP_DEFLATED;z.writestr(info,p.read_bytes())
# Byte equality verifies all archive entries, fixed timestamps, no identity path.
with ZipFile(archive) as z:
for entry in z.infolist():
assert entry.date_time==(1980,1,1,0,0,0) and not entry.filename.startswith('/') and '..' not in Path(entry.filename).parts
assert z.read(entry.filename)==(bundle/entry.filename).read_bytes()
report={'status':'120_BLIND_PAIRS_PACKAGED_NOT_REVIEWED','pairs':120,'unique_geometry_parts':232,'blind_files':len(records)+1,'blind_bytes':sum(r['bytes'] for r in records)+(bundle/'manifest.json').stat().st_size,'zip_bytes':archive.stat().st_size,'zip_sha256':sha(archive),'bundle_manifest_sha256':sha(bundle/'manifest.json'),'sampling_mapping_seal':seal,'all_pair_schemas_and_hashes_pass':True,'zip_entries_full_byte_check_pass':True,'zip_timestamps_normalized':True,'blank_labels':True,'cpu_seconds':sum(resource.getrusage(resource.RUSAGE_SELF)[:2]),'wall_seconds':time.monotonic()-start,'peak_rss_bytes':resource.getrusage(resource.RUSAGE_SELF).ru_maxrss*1024}
(ROOT/'public/package-result.json').write_text(json.dumps(report,indent=2)+'\n');print(json.dumps(report))
if __name__=='__main__':main()
@@ -0,0 +1,27 @@
{
"scope": "package the same sealed120 pair sample only after232 successful geometry receipts",
"source_sha256": {
"tools/build_g1_blind120_package.py": "2fb1edbb21edd7baf1ab0921e16bb05e79573c737647dd691514ef7f9b7d7838",
"tools/g1_blind_geometry.py": "9f8303264231fd16f011817998758bd9c9221e6488a4b87a16e8b5e719e0845c",
"tools/s2_e1_supervisor.py": "6753c9ceb0b932047ba505bd15681f109e9407bdb58fd96c55e1431a3f1b4a02"
},
"resource_limits": {
"cpu_seconds": 1800,
"wall_seconds": 1800,
"tree_rss_bytes": 1342177280,
"stage_disk_bytes": 8589934592,
"max_processes": 8
},
"seals_verified_before_packaging": true,
"all_surface_payloads_checked_against_producer_hashes": true,
"pair_schema_validation": true,
"zip_fixed_timestamp": [
1980,
1,
1,
0,
0,
0
],
"blind_fields": "opaque pair IDs, raw coordinates, triangles, uniform PNG views, blank labels, hashes and completeness notes only"
}
@@ -0,0 +1,37 @@
"""Integration fixture has 232 invented names and tiny tetrahedra, no project data."""
import contextlib,hashlib,io,json,tempfile,unittest
from pathlib import Path
from PIL import Image
import numpy as np
import build_g1_blind120_package as b
from g1_blind_geometry import ply_bytes
def save(p,x):p.parent.mkdir(parents=True,exist_ok=True);p.write_text(json.dumps(x))
class PackageTest(unittest.TestCase):
def test_whole_synthetic_package_and_blank_labels(self):
old=b.ROOT
with tempfile.TemporaryDirectory() as t:
b.ROOT=Path(t);root=b.ROOT;cases=[f'synthetic-{i}' for i in range(232)];secret=bytes(32)
pairs=[(cases[2*i],cases[2*i+1]) for i in range(116)]+[(cases[0],cases[2]),(cases[1],cases[3]),(cases[4],cases[6]),(cases[5],cases[7])]
rows=[{'a':a,'b':c,'left':a,'right':c,'anonymous_pair_id':f'{i:032x}'} for i,(a,c) in enumerate(pairs)]
m={'pairs':rows,'unique_cases':cases,'anonymous_id_secret_hex':secret.hex()};save(root/'custodian/sampling-and-mapping.json',m)
save(root/'custodian/geometry-source-index.json',{'fixture':True})
save(root/'public/sample-summary-and-seals.json',{'sealed_files':[{'file':n,'sha256':b.sha(root/'custodian'/n)} for n in ['sampling-and-mapping.json','geometry-source-index.json']]})
save(root/'custodian/batch-complete.json',{'parts':232,'all_pass':True})
for case in cases:
aid=hashlib.sha256(secret+b'asset\0'+case.encode()).hexdigest()[:32];d=root/'custodian/geometry'/aid;d.mkdir(parents=True)
(d/'surface.ply').write_bytes(ply_bytes(np.array([[0.,0,0],[1,0,0],[0,1,0]]),np.array([[0,1,2]])))
for name in ['overview','detail-grid']:Image.new('RGB',(1,1),'white').save(d/(name+'.png'))
save(d/'receipt.json',{'files':[{'name':p.name,'bytes':p.stat().st_size,'sha256':b.sha(p)} for p in sorted(d.iterdir())]})
try:
with contextlib.redirect_stdout(io.StringIO()):b.main()
r=json.loads((root/'public/package-result.json').read_text());self.assertEqual(r['pairs'],120);self.assertTrue(r['zip_entries_full_byte_check_pass'])
self.assertEqual(len(list((root/'blind-package/review-pairs').glob('*.md'))),120)
import csv
with (root/'blind-package/blank-review.csv').open() as f:labels=list(csv.DictReader(f))
self.assertEqual(len(labels),120);self.assertTrue(all(not v for row in labels for k,v in row.items() if k!='anonymous_pair_id'))
self.assertNotIn('synthetic-',(root/'blind-package/manifest.json').read_text())
save(root/'custodian/geometry-source-index.json',{'fixture':'changed'})
with self.assertRaises(AssertionError):b.main()
finally:b.ROOT=old
if __name__=='__main__':unittest.main()
@@ -0,0 +1,10 @@
{
"returncode": 0,
"cpu_seconds": 1.068467,
"wall_seconds": 1.0714350499911234,
"scope": "same synthetic fixture; added enforcement of all sealed source files and tamper rejection",
"code_sha256": {
"tools/build_g1_blind120_package.py": "2fb1edbb21edd7baf1ab0921e16bb05e79573c737647dd691514ef7f9b7d7838",
"tools/test_g1_blind_package.py": "f3172784b5ff141999ad52108451345e79af81354c7613d6e14a58031cd74e69"
}
}
@@ -0,0 +1,6 @@
test_whole_synthetic_package_and_blank_labels (test_g1_blind_package.PackageTest) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.836s
OK
@@ -0,0 +1,10 @@
{
"returncode": 0,
"cpu_seconds": 1.2408739999999998,
"wall_seconds": 1.2433793080272153,
"scope": "120 invented pairs /232 invented names with synthetic tiny triangles and 1px images; no real geometry",
"code_sha256": {
"tools/build_g1_blind120_package.py": "fa0ebf94ab4ade544eb705e5aec7f64d4922b52417da9a2a7283d9d82d637ef1",
"tools/test_g1_blind_package.py": "94149f0d7bda92941b2a7743bb1996e047fd1b48b2089bcc32364dbbac8437d6"
}
}
@@ -0,0 +1,6 @@
test_whole_synthetic_package_and_blank_labels (test_g1_blind_package.PackageTest) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.821s
OK