Skip to content

Commit 0a9946c

Browse files
committed
fix: verify page handles Many-Worlds ensemble alloys
- Shows target model + specialists table (not just source.baseModel) - Reads trustLevel from top-level integrity (not just results.integrity) - Fixes "undefined cycle" for alloys without cycles field - Architecture shows alloy type for ensembles
1 parent 4eb7b1f commit 0a9946c

1 file changed

Lines changed: 31 additions & 12 deletions

File tree

verify/index.html

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,8 @@ <h1>ForgeAlloy — Chain of Custody</h1>
631631
const actualHash = await sha256hex(text);
632632

633633
const r = alloy.results || {};
634-
const i = r.integrity || {};
634+
// Handle both forged (results.integrity) and ensemble (top-level integrity) alloys
635+
const i = r.integrity || alloy.integrity || {};
635636
const code = i.code || {};
636637
const receipt = alloy.receipt || {};
637638

@@ -688,22 +689,39 @@ <h1>ForgeAlloy — Chain of Custody</h1>
688689
chainEl.className = 'chain visible';
689690
chainEl.innerHTML = '';
690691

691-
// --- Source Model ---
692-
const baseModel = alloy.source?.baseModel || '?';
692+
// --- Source Model(s) ---
693+
// Handle both forged models (source.baseModel) and ensembles (source.target + source.specialists)
693694
const srcTrust = assessNodeTrust('source', alloy);
694695
tallyTrust(srcTrust);
695-
nodeRaw(chainEl, 'info', 'Source Model',
696-
'<a href="' + hfBase + baseModel + '" target="_blank">' + baseModel + '</a>' +
697-
trustBadgeHtml(srcTrust) +
698-
trustAnalysisHtml(TRUST_DEFS.source));
696+
if (alloy.source?.specialists) {
697+
// Many-Worlds ensemble — show target + specialists
698+
const targetModel = alloy.source.target?.baseModel || '?';
699+
nodeRaw(chainEl, 'info', 'Target Model',
700+
'<a href="' + hfBase + targetModel + '" target="_blank">' + targetModel + '</a>' +
701+
' <span style="color:#8a92a5">(' + (alloy.source.target?.role || 'generalist') + ')</span>' +
702+
trustBadgeHtml(srcTrust));
703+
for (const spec of alloy.source.specialists) {
704+
const specModel = spec.baseModel || '?';
705+
nodeRaw(chainEl, 'info', 'Specialist',
706+
'<a href="' + hfBase + specModel + '" target="_blank">' + specModel + '</a>' +
707+
' <span style="color:#00ffc8">(' + (spec.role || 'specialist') + ')</span>');
708+
}
709+
} else {
710+
// Standard forged model
711+
const baseModel = alloy.source?.baseModel || '?';
712+
nodeRaw(chainEl, 'info', 'Source Model',
713+
'<a href="' + hfBase + baseModel + '" target="_blank">' + baseModel + '</a>' +
714+
trustBadgeHtml(srcTrust) +
715+
trustAnalysisHtml(TRUST_DEFS.source));
716+
}
699717

700718
// --- Architecture ---
701-
const arch = alloy.source?.architecture || '?';
719+
const arch = alloy.source?.architecture || alloy.type || '?';
702720
nodeLink(chainEl, 'info', 'Architecture', arch,
703-
hfBase + 'docs/transformers/model_doc/' + arch.replace('_', ''), 'transformers docs');
721+
ghBase + 'forge-alloy#stage-types', alloy.type === 'many-worlds-ensemble' ? 'Many-Worlds logit blend' : 'transformers docs');
704722

705-
// --- Target ---
706-
if (alloy.target) {
723+
// --- Target (forged models only) ---
724+
if (alloy.target && !alloy.source?.specialists) {
707725
const deltas = Object.entries(alloy.target).filter(([k,v]) => v != null);
708726
const deltaHtml = deltas.map(([k]) => '<span style="color:#00ffc8">' + k + '</span>').join(', ');
709727
nodeRaw(chainEl, 'info', 'Target Delta', deltaHtml);
@@ -716,8 +734,9 @@ <h1>ForgeAlloy — Chain of Custody</h1>
716734
const stageHtml = alloy.stages.map(s =>
717735
'<a href="' + ghBase + 'forge-alloy#stage-types" target="_blank" style="color:#e0e6ed">' + s.type + '</a>'
718736
).join(' &#x2192; ');
737+
const cycleText = alloy.cycles ? ' (' + alloy.cycles + ' cycle' + (alloy.cycles > 1 ? 's' : '') + ')' : '';
719738
nodeRaw(chainEl, 'info', 'Pipeline',
720-
stageHtml + ' (' + alloy.cycles + ' cycle' + (alloy.cycles > 1 ? 's' : '') + ')' +
739+
stageHtml + cycleText +
721740
trustBadgeHtml(pipeTrust) +
722741
trustAnalysisHtml(TRUST_DEFS.pipeline));
723742
}

0 commit comments

Comments
 (0)