Repository navigation
Description
Finding
PR #1390 (merged, merge commit 37418e56339c315cf0ddf3e61c9c55c1e9d0c0a2) added roughly a thousand lines of new computation to the Cost Explorer's inline browser script in pm-stack/aggregator/src/render.ts — the recommendations engine, the Pareto frontier tables, the Pareto-gap inequality filters, and the task-assumptions projection — with no committed tests for any of that logic. The PR's test changes cover only the data layer (aaCaiPoints, caiFamily, catalog rate windows) plus HTML toContain assertions that the new sections' element ids exist. The PR body says the script was "runtime-smoke-tested against the fixture data" — a one-off manual check that is not in the repo and cannot regress.
Evidence
- PR: feat(pm): Cost Explorer — ChatGPT-site parity (CAI perspective, Pareto tables, recommendations, bands, projection) #1390 (MERGED 2026-10-27)
- New untested logic on current main, all inside the
AA_EXPLORER_SCRIPTtemplate string inpm-stack/aggregator/src/render.ts:render.ts:2092pctRank— percentile ranks shown in every Pareto table cellrender.ts:2105paretoSet— non-dominated set behind all four frontier tablesrender.ts:2170gapMetrics— score gap / price premium / speed gap behind the inequality filtersrender.ts:2814computeRecs— banding, near-top floors, relative price/speed ceilings, dominance removal, tradeoff ranking(relative time)^w × (relative price)^(1−w), lab-diversity passesrender.ts:3191project(+pjBandband/window selection) — projected $/task and time/task; the PR body hand-verifies one fixture case (~$0.106/task, ~5m 53s) that is not encoded as a test
pm-stack/aggregator/test/aa.test.tson current main contains zero references tocomputeRecs,project/pjBand,gapMetrics, orpctRank(grep-verified); the new render assertions areexpect(html).toContain('id="xpl-pf-score"')-style presence checks.
Why it matters
These functions produce numbers a reader acts on (shortlists, projected costs). Because they live in a template string, neither tsc nor the existing test suite exercises them at all — a sign flip in pctRank, a band-selection off-by-one in pjBand, or a dominance error in computeRecs ships silently. The one hand-verified projection example in the PR body is exactly the kind of case that should have become a fixture test.
Acceptance criteria
- The explorer script's pure computations (at minimum
project/pjBand,paretoSet,pctRank,gapMetrics, andcomputeRecsbanding/ranking) are covered by committed tests that run in the aggregator's normalbun test— e.g. by extracting them into an importable module the template string also uses, or by evaluating the script against the fixture data in a test harness. - The PR body's hand-verified projection case (Luna fixture rate: 3 turns × (10k uncached @ $0.75 + 10k cache reads @ $0.075 + 6k output @ $4.50) ≈ $0.106/task; time ≈ 5m 53s) is encoded as a test expectation.
- Existing suite stays green (
bun testinpm-stack/aggregator,bunx tsc --noEmitclean).
Found by pr-diff-review-b reviewing PR #1390's diff against current main. Remainder items for the same PR are already tracked in #1400; this test-coverage gap is not among them.
Activity
developing-today commentedon Oct 27, 2026
CODE-496
dezren39 commentedon Oct 27, 2026
🤖 Agent note · filed
bun testcoverage including the hand-verified projection case, per the issue's acceptance criteria.17 remaining items
dezren39 commentedon Nov 1, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done
e7510b90a658c532d680ffc88c8336c1080f645b, verdict: STILL VALID, not handled or superseded.pm-stack/aggregator/src/render.tsstill holds the computations inside the inline explorer script —pctRankat line 4054,paretoSetat line 4067,gapMetricsat line 4132,computeRecsat line 4963,pjBandat line 5396,projectat line 5418. Grep of current main test files:pm-stack/aggregator/test/aa.test.tsandpm-stack/aggregator/test/render.test.tscontain zero references to any of them; the only projection-related assertion remains an HTMLtoContain('data-pj="inputTokens"')presence check. Implementation follow-up enqueued as task 8097 with issue aggregator: Cost Explorer inline-script computations from PR #1390 (recommendations, Pareto, projection) ship with no committed tests #1405's acceptance criteria intact (packet: hidden_files/lane-i-task7707-fix-packet-1405.json in the keep-the-four-repos-healthy goal workspace). Issue aggregator: Cost Explorer inline-script computations from PR #1390 (recommendations, Pareto, projection) ship with no committed tests #1405 stays open, labelled queue/queued for task 8097; theuser/reviewintake is discharged — the review was done here and the verdict is proceed as scoped.dezren39 commentedon Nov 3, 2026
🤖 Agent note · done
1a180ae5test(aggregator): cover Cost Explorer client computations), merged 2026-11-03T14:47:30Z asadfa050a8. The pure computations (pctRank, paretoSet, gapMetrics, computeRecs, pjBand, project) moved from the AA_EXPLORER_SCRIPT template string intosrc/assets/aa-explorer-computations.js, served as a module and imported by the tests, so browser and tests run the same code.60ed6a997(main merged in, one comment-level conflict inrender.tsresolved in main's favour):bun test test/aa-explorer-computations.test.ts test/aa.test.ts49 pass / 0 fail;test/a11y-1215.test.ts14 pass / 0 fail. The PR feat(pm): Cost Explorer — ChatGPT-site parity (CAI perspective, Pareto tables, recommendations, bands, projection) #1390 hand-verified Luna projection (~$0.10575/task, 5m53s) is encoded as a test expectation. No merge-gating CI ran on the head (repo-widejules-daily-*startup failure, fix(ci): restore daily dispatch workflows (startup failure) + push-trigger audit #4595 track); CodeRabbit neutral.