Verify final OT route titles and official package byte graph

This commit is contained in:
Joseph Doherty
2026-11-14 02:18:05 -05:00
parent 65fa9137b8
commit 7013b6ce65
3 changed files with 457 additions and 1 deletions
@@ -12,6 +12,7 @@ for p in sorted(components.rglob('*.razor')):
if not routes:continue
rows.append({'file':str(p.relative_to(root)),'sha256':sha(p),'routes':routes,'pageTitleSourceOccurrences':len(re.findall(r'<PageTitle\b',text)),'h1SourceOccurrences':len(re.findall(r'<h1\b',text)),'delegatedGrammar':('LoginCard' if p.stem=='Login' else 'SecretsPage' if p.stem=='SecretsAdmin' else None),'note':'Source occurrence counts include conditional branches; they are not simultaneous rendered-heading counts or runtime coverage.'})
expected={'ZB.MOM.WW.Theme':'1.0.1','ZB.MOM.WW.Secrets.Ui':'1.0.1','ZB.MOM.WW.Secrets.Abstractions':'0.6.6','bunit':'2.7.2','AngleSharp':'1.5.2','AngleSharp.Css':'1.0.0-beta.157','AngleSharp.Diffing':'1.1.1'}
official_package_sha256={'ZB.MOM.WW.Theme': '995b117b0245577598c91404ed7957c071ebe3413696c8be48b419c9deb1bd5d', 'ZB.MOM.WW.Secrets.Ui': 'cd0efe497b2efa7acb61e634b727e802e883700d7c63681f895bcc4d0c6b816a', 'ZB.MOM.WW.Secrets.Abstractions': '5cb0386469638bda89eb6c9afa25ead397b86730c3c5e43e4e496269d316acdc'}
projects=[];errors=[]
for project in ['src/Server/ZB.MOM.WW.OtOpcUa.AdminUI','tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests']:
directory=root/project;assets=directory/'obj/project.assets.json';data=json.loads(assets.read_text());packages={k.split('/')[0]:k.split('/')[1] for k,v in data['libraries'].items() if v['type']=='package'}
@@ -31,7 +32,8 @@ for project in ['src/Server/ZB.MOM.WW.OtOpcUa.AdminUI','tests/Server/ZB.MOM.WW.O
candidate=list(folder.glob('lib/*/'+k+'.dll'));assert len(candidate)==1,candidate
runtime=Path('/tmp/ot14-root-stale-after') if project.startswith('src/') else directory/'bin/Release/net10.0'
dll=runtime/(k+'.dll');same=sha(dll)==sha(candidate[0]);assert same,(project,k)
proofs.append({'package':library,'nupkgSha256':sha(nupkg),'packageDllSha256':sha(candidate[0]),'inspectedRuntimeDll':str(dll),'inspectedRuntimeDllSha256':sha(dll),'runtimeDllMatchesPackage':same})
if sha(nupkg)!=official_package_sha256[k]:errors.append(f'{project}: {library} package bytes differ from accepted official delivery')
proofs.append({'package':library,'acceptedOfficialNupkgSha256':official_package_sha256[k],'nupkgSha256':sha(nupkg),'packageDllSha256':sha(candidate[0]),'inspectedRuntimeDll':str(dll),'inspectedRuntimeDllSha256':sha(dll),'runtimeDllMatchesPackage':same})
projects.append({'project':project,'assetsSha256':sha(assets),'resolvedSelectedPackages':selected,'packageAndRuntimeProof':proofs})
result={'capturedAtUtc':datetime.now(timezone.utc).isoformat(),'readOnlyExistingArtifacts':True,'noRestoreTestsNetworkPrivateStateOrEnvironmentRead':True,'routes':rows,'summary':{'routableComponents':len(rows),'routeTemplates':sum(len(r['routes']) for r in rows),'delegatedGrammarComponents':2},'projects':projects,'errors':errors,'limits':['Current authored route discovery, not deployed route acceptance.','Existing default Release assets, test DLLs and owned Release Hosts fixture package DLLs inspected, not a fresh restore/build/audit. Production AdminUI is an RCL whose standalone output need not copy runtime dependencies.','Final admin/cluster actual-component matrix and final full private-SQL suite remain primary-owned gates.','No test/package version is inferred from source alone; current assets and exact DLL bytes are recorded.']}
with out.open('x') as f:json.dump(result,f,indent=2);f.write('\n')