Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (agy): namespaced routing aliases, curve-filter set, and mixed ratio denominators

[._.]/ Adam Eivy352a3ece9dc0
diff --git a/client/src/components/models/ModelComparison.jsx b/client/src/components/models/ModelComparison.jsx
index 76af75ebe5..d2bdfb3819 100644
--- a/client/src/components/models/ModelComparison.jsx
+++ b/client/src/components/models/ModelComparison.jsx
@@ -320,13 +320,10 @@ export default function ModelComparison() {
};
const selectReasoningOnly = () => {
- // Counted over the same scoped rows the pills list, so the button's count
- // and the models it leaves selected agree.
- const allKnown = scoped.filter(r => r.benchmark === benchmark);
- const countMap = new Map();
- for (const r of allKnown) countMap.set(r.model, (countMap.get(r.model) || 0) + 1);
- const toHide = models.filter(m => (countMap.get(m) || 0) < 2);
- setAllHidden('hideModel', toHide);
+ // Keyed on the models that actually PLOT a curve — the same set the button's
+ // count names. Counting catalog rows instead would leave models selected
+ // that have two efforts but no plottable cost at either.
+ setAllHidden('hideModel', models.filter(model => !reasoningCurveModels.includes(model)));
};
const clearAllModels = () => {
diff --git a/client/src/components/models/ModelComparison.test.jsx b/client/src/components/models/ModelComparison.test.jsx
index f7fc68e874..4043a1b08a 100644
--- a/client/src/components/models/ModelComparison.test.jsx
+++ b/client/src/components/models/ModelComparison.test.jsx
@@ -165,3 +165,24 @@ it('plots an unpublished effort cost as a flagged estimate that can be turned of
expect(screen.getByTestId('scatter-claude-fable-5.1')).toHaveAttribute('data-points', '1');
expect(screen.queryByText(/· 1 estimated cost/)).toBeNull();
});
+
+it('leaves only the models that actually plot a curve selected', async () => {
+ const mixed = [
+ // Two efforts, both plottable → a real curve.
+ { ...observation, id: 'p-low', model: 'gpt-5.6-sol', effort: 'low', quality: metric(41), costPerTask: metric(0.2) },
+ { ...observation, id: 'p-max', model: 'gpt-5.6-sol', effort: 'max', quality: metric(51), costPerTask: metric(1.2) },
+ // Two efforts, neither plottable (no cost anywhere in the family, so no
+ // anchor to estimate from) → must not survive the quick filter.
+ { ...observation, id: 'u-low', model: 'unpriced-model', effort: 'low', quality: metric(30), costPerTask: null },
+ { ...observation, id: 'u-max', model: 'unpriced-model', effort: 'max', quality: metric(35), costPerTask: null },
+ ];
+ api.getModelComparison.mockResolvedValue({ schemaVersion: 1, observations: mixed, inventory: [] });
+
+ render(<MemoryRouter><ModelComparison /></MemoryRouter>);
+ await act(async () => {});
+
+ await screen.findByText(/1 reasoning curves/);
+ fireEvent.click(screen.getByText(/Reasoning curves \(1\)/));
+ expect(screen.getByRole('button', { name: 'Toggle gpt-5.6-sol' })).toHaveAttribute('aria-pressed', 'true');
+ expect(screen.getByRole('button', { name: 'Toggle unpriced-model' })).toHaveAttribute('aria-pressed', 'false');
+});
diff --git a/client/src/lib/effortCostEstimate.js b/client/src/lib/effortCostEstimate.js
index a265f917d6..4f5bfdd400 100644
--- a/client/src/lib/effortCostEstimate.js
+++ b/client/src/lib/effortCostEstimate.js
@@ -67,11 +67,25 @@ function anchorOf(rows) {
}
function ratiosFromFamilies(families) {
- const samples = new Map();
+ const calibrating = [];
for (const rows of families.values()) {
const priced = rows.filter(isPriced);
- if (priced.length < 2) continue;
- const anchor = anchorOf(priced);
+ if (priced.length >= 2) calibrating.push({ priced, anchor: anchorOf(priced) });
+ }
+ // Every sample has to share one denominator. A family whose top published cost
+ // is xhigh contributes xhigh/xhigh = 1 to the same pool as a complete family's
+ // xhigh/max ≈ 0.72, and the median across those two denominators is not a ratio
+ // of anything — so the baseline is the highest effort any family is anchored at,
+ // and only families anchored there calibrate. Reading it from the data rather
+ // than naming 'max' keeps it right if the ladder grows a rung above it.
+ const baseline = calibrating.reduce(
+ (best, family) => (best === null || rank(family.anchor.effort) > rank(best) ? family.anchor.effort : best),
+ null
+ );
+
+ const samples = new Map();
+ for (const { priced, anchor } of calibrating) {
+ if (anchor.effort !== baseline) continue;
for (const row of priced) {
if (!samples.has(row.effort)) samples.set(row.effort, []);
samples.get(row.effort).push(row.costPerTask.value / anchor.costPerTask.value);
diff --git a/client/src/lib/effortCostEstimate.test.js b/client/src/lib/effortCostEstimate.test.js
index 6c79d54672..d3e4f3f6b4 100644
--- a/client/src/lib/effortCostEstimate.test.js
+++ b/client/src/lib/effortCostEstimate.test.js
@@ -35,6 +35,18 @@ describe('deriveEffortCostRatios', () => {
it('ignores families that publish fewer than two ladder costs', () => {
expect(deriveEffortCostRatios([row('anchored', 'max', 10)]).size).toBe(0);
});
+
+ it('calibrates only against families anchored at the highest published effort', () => {
+ // 'short' tops out at high, so its high/high = 1 must not pool with
+ // full-curve's high/max = 0.5 — the two have different denominators.
+ const ratios = deriveEffortCostRatios([
+ ...catalog,
+ row('short', 'medium', 5),
+ row('short', 'high', 10),
+ ]);
+ expect(ratios.get('high')).toBeCloseTo(0.5);
+ expect(ratios.get('medium')).toBeCloseTo(0.2);
+ });
});
describe('withEstimatedCosts', () => {
diff --git a/server/lib/comparisonModelScope.js b/server/lib/comparisonModelScope.js
index 8eaed70945..3bd94d49ea 100644
--- a/server/lib/comparisonModelScope.js
+++ b/server/lib/comparisonModelScope.js
@@ -87,6 +87,11 @@ export function catalogSlugForProviderModel(modelId) {
const prefix = PREFIXES.find(candidate => slug.startsWith(candidate));
if (prefix) slug = slug.slice(prefix.length);
slug = slug.slice(slug.lastIndexOf('/') + 1); // vendor / gateway namespace
+ // Re-test after stripping: a routing alias reaches us namespaced
+ // (`opencode/big-pickle`), which the anchored pattern misses in its full form.
+ // The first test still has to happen before stripping, because some patterns
+ // (`stealth/…`) match only the namespaced form.
+ if (NOT_A_MODEL.test(slug)) return '';
slug = canonicalCatalogModelSlug(slug.replace(TAIL, ''));
return ALIASES.get(slug) || slug;
}
diff --git a/server/lib/comparisonModelScope.test.js b/server/lib/comparisonModelScope.test.js
index 715c72ba08..da0bd1ac55 100644
--- a/server/lib/comparisonModelScope.test.js
+++ b/server/lib/comparisonModelScope.test.js
@@ -36,6 +36,13 @@ describe('catalogSlugForProviderModel', () => {
expect(catalogSlugForProviderModel(entry)).toBe('');
}
});
+
+ it('rejects a routing alias that arrives namespaced, and one that is only recognizable namespaced', () => {
+ // 'opencode/big-pickle' matches the alias only after the namespace comes off;
+ // 'stealth/ox-alpha' matches only before it does.
+ expect(catalogSlugForProviderModel('opencode/big-pickle')).toBe('');
+ expect(catalogSlugForProviderModel('stealth/ox-alpha')).toBe('');
+ });
});
describe('canonicalCatalogModelSlug', () => {