Concept Mill benches: versioned prompt data, a round driver over raven-image, a structural screen, bench rows
benches/nibu.yaml owns prompt text and item identity; bench.mjs plans frozen rounds, previews captions, renders through raven-image and screens renders on Raven's Ollama; build.mjs adds one Mill row per bench item (menuGroup, promptText, generation, grade badge) and passes withoutEnlargement. A grade ranks and never hides. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ba577bd2cf
commit
1ee54116c3
6 changed files with 741 additions and 29 deletions
|
|
@ -13,12 +13,17 @@ type Variant = {
|
|||
verdict?: string
|
||||
operator?: string
|
||||
pick: boolean
|
||||
promptText?: string
|
||||
generation?: string
|
||||
// A bench render's structural grade: a rank and an annotation, never a filter.
|
||||
screen?: { grade: "pass" | "doubt" | "fail"; reason: string; corrected: boolean; modelGrade?: string }
|
||||
}
|
||||
type Ship = {
|
||||
id: string
|
||||
name: string
|
||||
code: string
|
||||
faction: string
|
||||
menuGroup: string
|
||||
role: string
|
||||
desig: string
|
||||
crew: string
|
||||
|
|
@ -85,12 +90,12 @@ function setup(root: HTMLElement) {
|
|||
const inSection = ships.filter((s) => s.status.kind === section.kind)
|
||||
if (!inSection.length) continue
|
||||
menuHtml += `<section class="cm-group is-${section.kind}"><h2>${esc(section.title)} <span>${inSection.length}</span></h2>`
|
||||
for (const faction of [...new Set(inSection.map((s) => s.faction))]) {
|
||||
menuHtml += `<h3>${esc(faction)}</h3><ul>`
|
||||
for (const ship of inSection.filter((s) => s.faction === faction)) {
|
||||
for (const group of [...new Set(inSection.map((s) => s.menuGroup))]) {
|
||||
menuHtml += `<h3>${esc(group)}</h3><ul>`
|
||||
for (const ship of inSection.filter((s) => s.menuGroup === group)) {
|
||||
const i = ships.indexOf(ship)
|
||||
const v = ship.variants.find((x) => x.id === ship.defaultVariant)!
|
||||
menuHtml += `<li><button type="button" class="cm-item is-${ship.status.kind}" data-ship="${i}"><img src="${v.thumb}" alt="" loading="lazy" width="720" height="540" /><span class="cm-item-name">${esc(ship.name)}</span><span class="cm-item-role">${esc(ship.role)}${ship.variants.length > 1 ? ` · ${ship.variants.length} renders` : ""}</span></button></li>`
|
||||
menuHtml += `<li><button type="button" class="cm-item is-${ship.status.kind}" data-ship="${i}"><img src="${v.thumb}" alt="" loading="lazy" width="720" height="540" /><span class="cm-item-name">${esc(ship.name)}</span><span class="cm-item-role">${esc(ship.role)}${ship.variants.length > 1 ? ` · ${ship.variants.length} renders` : ""}${ship.variants.some((x) => x.screen) ? ` · ${ship.variants.reduce((n, x) => n + (x.screen?.grade === "pass" ? 1 : 0), 0)} pass` : ""}</span></button></li>`
|
||||
}
|
||||
menuHtml += `</ul>`
|
||||
}
|
||||
|
|
@ -273,13 +278,13 @@ function setup(root: HTMLElement) {
|
|||
? `<div class="cm-rounds" role="group" aria-label="Render rounds">${ship.variants
|
||||
.map(
|
||||
(v) =>
|
||||
`<button type="button" data-variant="${esc(v.id)}" class="${v.id === variant.id ? "is-current" : ""}${v.pick ? " is-pick" : ""}" aria-pressed="${v.id === variant.id}"><img src="${v.thumb}" alt="" loading="lazy" width="720" height="540" /><span>${esc(v.round)}</span></button>`,
|
||||
`<button type="button" data-variant="${esc(v.id)}" class="${v.id === variant.id ? "is-current" : ""}${v.pick ? " is-pick" : ""}" aria-pressed="${v.id === variant.id}"><img src="${v.thumb}" alt="" loading="lazy" width="720" height="540" /><span>${esc(v.round)}</span>${v.screen ? `<b class="cm-grade is-${v.screen.grade}" title="${esc(`${v.screen.corrected ? "Corrected by the operator" : "Structural screen"}: ${v.screen.grade}`)}">${v.screen.grade}${v.screen.corrected ? " *" : ""}</b>` : ""}</button>`,
|
||||
)
|
||||
.join("")}</div>`
|
||||
: ""
|
||||
const note =
|
||||
variant.hypothesis || variant.verdict || variant.operator
|
||||
? `<div class="cm-variant-note">${variant.hypothesis ? `<p><span class="cm-k">Hypothesis</span>${esc(variant.hypothesis)}</p>` : ""}${variant.verdict ? `<p><span class="cm-k">Lab verdict</span>${esc(variant.verdict)}</p>` : ""}${variant.operator ? `<p class="cm-operator"><span class="cm-k">Operator</span>“${esc(variant.operator)}”</p>` : ""}</div>`
|
||||
variant.hypothesis || variant.verdict || variant.operator || variant.promptText || variant.screen
|
||||
? `<div class="cm-variant-note">${variant.hypothesis ? `<p><span class="cm-k">Hypothesis</span>${esc(variant.hypothesis)}</p>` : ""}${variant.promptText ? `<p><span class="cm-k">Prompt</span>${esc(variant.promptText)}</p>` : ""}${variant.generation ? `<p><span class="cm-k">Generation</span>${esc(variant.generation)}</p>` : ""}${variant.screen ? `<p><span class="cm-k">${variant.screen.corrected ? "Screen, corrected" : "Screen"}</span>${esc(variant.screen.grade)}${variant.screen.corrected && variant.screen.modelGrade ? ` (model: ${esc(variant.screen.modelGrade)})` : ""}${variant.screen.reason ? `: ${esc(variant.screen.reason)}` : ""}</p>` : ""}${variant.verdict ? `<p><span class="cm-k">Lab verdict</span>${esc(variant.verdict)}</p>` : ""}${variant.operator ? `<p class="cm-operator"><span class="cm-k">Operator</span>“${esc(variant.operator)}”</p>` : ""}</div>`
|
||||
: ""
|
||||
const tally = votesOn && tallies?.[ship.id]
|
||||
const votes = votesOn
|
||||
|
|
@ -301,14 +306,14 @@ function setup(root: HTMLElement) {
|
|||
<div><dt>Mass class</dt><dd>${esc(ship.mass)}</dd></div>
|
||||
<div class="cm-wide"><dt>Status</dt><dd>${esc(ship.status.verdict)}</dd></div>
|
||||
</dl>
|
||||
<div class="cm-row" style="--i:3">
|
||||
${ship.hardpoints.length ? `<div class="cm-row" style="--i:3">
|
||||
<p class="cm-label">Hardpoints <span class="cm-glyphs" aria-hidden="true">${glyphs}</span></p>
|
||||
<table class="cm-hp"><thead><tr><th>Qty</th><th>Size</th><th>Mount · arc</th></tr></thead><tbody>${rows}</tbody></table>
|
||||
</div>
|
||||
<div class="cm-row" style="--i:4"><p class="cm-label">Default loadout</p><ul class="cm-loadout">${ship.loadout.map((x) => `<li>${esc(x)}</li>`).join("")}</ul></div>
|
||||
</div>` : ""}
|
||||
${ship.loadout.length ? `<div class="cm-row" style="--i:4"><p class="cm-label">Default loadout</p><ul class="cm-loadout">${ship.loadout.map((x) => `<li>${esc(x)}</li>`).join("")}</ul></div>` : ""}
|
||||
<div class="cm-row" style="--i:5"><p class="cm-label">Play concept</p><p>${esc(ship.concept)}</p></div>
|
||||
<div class="cm-row" style="--i:6"><p class="cm-label">Notes</p><p>${esc(ship.notes)}</p></div>
|
||||
<div class="cm-row cm-beaten" style="--i:7"><p class="cm-label">Beaten by</p><p>${esc(ship.beaten)}</p></div>
|
||||
${ship.beaten ? `<div class="cm-row cm-beaten" style="--i:7"><p class="cm-label">Beaten by</p><p>${esc(ship.beaten)}</p></div>` : ""}
|
||||
${votes}
|
||||
<p class="cm-links cm-row" style="--i:8"><a href="${variant.prompt}" target="_blank" rel="noopener" data-router-ignore data-no-popover="true">Prompt record ↗</a><a href="${variant.image}" target="_blank" rel="noopener" data-router-ignore data-no-popover="true">Full render ↗</a></p>`
|
||||
if (animate && !reduce) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue