GeezerVison is showing github.com — feat(pm-stack): unpriced-variant detail buttons under Cost Explorer c… · developing-today/code@af7d99c
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: pm-stack/aggregator/src/assets/aa-explorer-computations.d.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -49,6 +49,7 @@ export function computeRecommendations< | 49 | 49 | empty: string | null; | 50 | 50 | }; | 51 | 51 | export function normName(value: unknown): string; | | 52 | +export function unpricedScoredPoints<T extends { score?: number | null; cost?: number | null; family?: string; effort?: string | null }>(points: T[]): T[]; | 52 | 53 | export function projectTask( | 53 | 54 | model: any, | 54 | 55 | settings: Record<string, number | string>, | |
Collapse file Copy file name to clipboardExpand all lines: pm-stack/aggregator/src/assets/aa-explorer-computations.js +17Lines changed: 17 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -262,3 +262,20 @@ export function projectTask(e, settings, aaPoints, caiPoints) { | 262 | 262 | if (timing && timing.tps) time = turns * ((timing.ttft || 0) + answer / timing.tps + (Number(settings.overheadSec) || 0)); | 263 | 263 | return { cost: cost, time: time, band: band }; | 264 | 264 | } | | 265 | + | | 266 | +export function unpricedScoredPoints(points) { | | 267 | + // #1400 remainder: configurations that carry a score but no published | | 268 | + // cost. They cannot appear on any cost chart, so the explorer lists | | 269 | + // them as detail-opening buttons instead. Input order is the caller's | | 270 | + // visible set (filters/hidden already applied); this helper only | | 271 | + // selects and orders: score descending, then family/effort for a | | 272 | + // stable, scannable list. No score/cost computation happens here. | | 273 | + return (points || []) | | 274 | + .filter(function (p) { return p && p.score != null && p.cost == null; }) | | 275 | + .slice() | | 276 | + .sort(function (a, b) { | | 277 | + return (b.score - a.score) | | 278 | + || String(a.family || "").localeCompare(String(b.family || "")) | | 279 | + || String(a.effort || "").localeCompare(String(b.effort || "")); | | 280 | + }); | | 281 | +} |
Collapse file Copy file name to clipboardExpand all lines: pm-stack/aggregator/src/render.ts +30-2Lines changed: 30 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4012,7 +4012,7 @@ ${dnsTable(section.entries, renewingSoon, next)}`; | 4012 | 4012 | * Written without template literals on purpose — it lives inside one. | 4013 | 4013 | */ | 4014 | 4014 | const AA_EXPLORER_SCRIPT = `<script type="module"> | 4015 | | -import { applyInequalityFilters, bandIndex, computeRecommendations, logEdges, normName, paretoSet, pctRank, projectTask, scoreEdges } from "/assets/aa-explorer-computations.js"; | | 4015 | +import { applyInequalityFilters, bandIndex, computeRecommendations, logEdges, normName, paretoSet, pctRank, projectTask, scoreEdges, unpricedScoredPoints } from "/assets/aa-explorer-computations.js"; | 4016 | 4016 | (function () { | 4017 | 4017 | var dataEl = document.getElementById("xpl-data"); | 4018 | 4018 | if (!dataEl) return; | @@ -4752,6 +4752,33 @@ import { applyInequalityFilters, bandIndex, computeRecommendations, logEdges, no | 4752 | 4752 | }); | 4753 | 4753 | } | 4754 | 4754 | // --- hidden tray (reference design's hide-a-configuration flow) --- | | 4755 | + function renderUnpriced() { | | 4756 | + // #1400 remainder: visible scored configurations with no published | | 4757 | + // cost cannot appear on the cost charts; list them under the charts | | 4758 | + // as real buttons that open the existing detail card via | | 4759 | + // selectPoint — the same flow as clicking a dot or a table row. | | 4760 | + // visPoints() already applies every filter and the hidden set. | | 4761 | + var box = document.getElementById("xpl-unpriced"); | | 4762 | + if (!box) return; | | 4763 | + var rows = unpricedScoredPoints(visPoints()); | | 4764 | + box.innerHTML = ""; | | 4765 | + if (!rows.length) { | | 4766 | + var none = document.createElement("p"); | | 4767 | + none.className = "muted"; | | 4768 | + none.textContent = "No visible scored configurations are missing a published cost."; | | 4769 | + box.appendChild(none); | | 4770 | + return; | | 4771 | + } | | 4772 | + rows.forEach(function (p) { | | 4773 | + var b = document.createElement("button"); | | 4774 | + b.type = "button"; | | 4775 | + b.className = "xpl-ctl-btn"; | | 4776 | + b.setAttribute("data-unpriced", p.key); | | 4777 | + b.textContent = (p.family || p.key) + (p.effort ? " \u2014 " + p.effort : "") + " \u00b7 " + scoreWord() + " " + fmtN(p.score, 1) + " \u00b7 no published cost"; | | 4778 | + b.addEventListener("click", function () { selectPoint(p.key); }); | | 4779 | + box.appendChild(b); | | 4780 | + }); | | 4781 | + } | 4755 | 4782 | function renderTray() { | 4756 | 4783 | var tray = document.getElementById("xpl-tray"); | 4757 | 4784 | if (!tray) return; | @@ -5384,7 +5411,7 @@ import { applyInequalityFilters, bandIndex, computeRecommendations, logEdges, no | 5384 | 5411 | : "Intelligence & decode perspective — the AA Intelligence Index rankings: score is the Intelligence Index, cost and time the import's per-task figures (time excludes TTFT)."; | 5385 | 5412 | } | 5386 | 5413 | applyTab(); | 5387 | | - if (S.tab === "aa") { renderLegend(); renderTray(); drawCharts(); renderAaTable(); renderPareto(); renderRecs(); renderBandComparisons(); } | | 5414 | + if (S.tab === "aa") { renderLegend(); renderTray(); drawCharts(); renderUnpriced(); renderAaTable(); renderPareto(); renderRecs(); renderBandComparisons(); } | 5388 | 5415 | else renderModels(); | 5389 | 5416 | enhanceCharts(); | 5390 | 5417 | } | @@ -5855,6 +5882,7 @@ ${aaTabAge} | 5855 | 5882 | <div class="chart" data-chart="xpl-c5"><h3>Multiples of the baseline</h3><span class="xpl-ctl"><label>Baseline <select id="xf-baseline"></select></label><button type="button" data-dl="xpl-c5">Download PNG</button></span><span class="chart-tools" data-tools="xpl-c5"><button type="button" data-zact="expand" data-zfor="xpl-c5">⤢ Expand</button><button type="button" data-zact="in" data-zfor="xpl-c5" aria-label="Zoom in">+</button><button type="button" data-zact="out" data-zfor="xpl-c5" aria-label="Zoom out">−</button><button type="button" data-zact="reset" data-zfor="xpl-c5" aria-label="Reset view">⟲</button></span><svg id="xpl-c5" viewBox="0 0 680 400" role="img" aria-label="Cost and duration multiples scatter chart"></svg><p class="muted" data-note></p></div> | 5856 | 5883 | <div class="chart" data-chart="xpl-c6"><h3>Scores — every measured configuration</h3><span class="xpl-ctl"><button type="button" data-dl="xpl-c6">Download PNG</button></span><span class="chart-tools" data-tools="xpl-c6"><button type="button" data-zact="expand" data-zfor="xpl-c6">⤢ Expand</button><button type="button" data-zact="in" data-zfor="xpl-c6" aria-label="Zoom in">+</button><button type="button" data-zact="out" data-zfor="xpl-c6" aria-label="Zoom out">−</button><button type="button" data-zact="reset" data-zfor="xpl-c6" aria-label="Reset view">⟲</button></span><svg id="xpl-c6" viewBox="0 0 680 400" role="img" aria-label="Scores bar chart"></svg><p class="muted" data-note></p></div> | 5857 | 5884 | </div> | | 5885 | +<div class="card" id="xpl-unpriced-wrap"><h3>Scored configurations without a published cost</h3><p class="muted">These visible configurations have a score but no published cost, so they cannot appear on the cost charts. Select one to open its detail card.</p><div id="xpl-unpriced" class="strip"></div></div> | 5858 | 5886 | <p class="muted">Time is seconds to finish one task (log scale), not tokens/sec — a model can stream fast and still finish slowly if it burns many tokens, and per-task time here excludes time to first token (shown separately where timed). Thin lines join each model's effort rungs (DeepSeek ladders dotted); the white dashed line is that chart's Pareto frontier; white-ringed dots sit on it, dimmed dots are beaten on its axes. Bracket splits: cost $0.15 / $0.75 / $2.50, time 1m / 5m / 15m. Only measured configurations are plotted — nothing is estimated, so configurations AA never timed appear in the tables, not the time charts. DeepSeek prices split peak / off-peak: peak is 01:00–04:00 and 06:00–10:00 UTC Monday–Friday at double the off-peak token rates, so the same runs appear at two costs. Click a dot or a row for details.</p> | 5859 | 5887 | <h2>Multiples table</h2> | 5860 | 5888 | <p class="muted">Every visible configuration with all three measures, as multiples of the baseline chosen above, sorted by cost multiple.</p> | |
Collapse file Copy file name to clipboardExpand all lines: pm-stack/aggregator/test/aa-explorer-computations.test.ts +27Lines changed: 27 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | pctRank, | 10 | 10 | projectTask, | 11 | 11 | scoreEdges, | | 12 | + unpricedScoredPoints, | 12 | 13 | } from "../src/assets/aa-explorer-computations.js"; | 13 | 14 |
| 14 | 15 | describe("Cost Explorer browser computations", () => { | @@ -127,3 +128,29 @@ describe("Cost Explorer browser computations", () => { | 127 | 128 | expect(projectTask(missingCacheRate, settings, [point], []).cost).toBeNull(); | 128 | 129 | }); | 129 | 130 | }); | | 131 | + | | 132 | +describe("unpricedScoredPoints (#1400 remainder)", () => { | | 133 | + const rows = [ | | 134 | + { key: "priced", family: "Beta", effort: "high", score: 50, cost: 1.2 }, | | 135 | + { key: "unpriced-low", family: "Alpha", effort: "low", score: 30, cost: null }, | | 136 | + { key: "unpriced-high", family: "Alpha", effort: "high", score: 70, cost: null }, | | 137 | + { key: "unscored", family: "Gamma", effort: "low", score: null, cost: null }, | | 138 | + { key: "unpriced-mid", family: "Beta", effort: "med", score: 50, cost: undefined }, | | 139 | + ]; | | 140 | + test("selects scored-but-unpriced only, ordered by score desc", () => { | | 141 | + expect(unpricedScoredPoints(rows).map((r) => r.key)).toEqual([ | | 142 | + "unpriced-high", | | 143 | + "unpriced-mid", | | 144 | + "unpriced-low", | | 145 | + ]); | | 146 | + }); | | 147 | + test("empty state: no unpriced scored rows yields an empty list", () => { | | 148 | + expect(unpricedScoredPoints([rows[0], rows[3]])).toEqual([]); | | 149 | + expect(unpricedScoredPoints([])).toEqual([]); | | 150 | + }); | | 151 | + test("does not mutate the input rows or their order", () => { | | 152 | + const before = rows.map((r) => r.key); | | 153 | + unpricedScoredPoints(rows); | | 154 | + expect(rows.map((r) => r.key)).toEqual(before); | | 155 | + }); | | 156 | +}); |
Collapse file Copy file name to clipboardExpand all lines: pm-stack/aggregator/test/aa.test.ts +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -627,6 +627,9 @@ describe("aa-explorer manifest + render", () => { | 627 | 627 | expect(html).toContain('id="xpl-c4"'); // tasks completed vs duration | 628 | 628 | expect(html).toContain('id="xpl-c5"'); // multiples of the baseline | 629 | 629 | expect(html).toContain('id="xpl-c6"'); // scores-only bars | | 630 | + expect(html).toContain('id="xpl-unpriced"'); // #1400: unpriced-variant detail buttons mount under the charts | | 631 | + expect(html).toContain("Scored configurations without a published cost"); | | 632 | + expect(html).toContain("unpricedScoredPoints"); // the explorer script wires the button list from the computations module | 630 | 633 | expect(html).toContain('data-sizeby="xpl-c1"'); | 631 | 634 | expect(html).toContain('data-dl="xpl-c2"'); | 632 | 635 | expect(html).toContain('data-tmode="tot"'); | |
|