feat(miner-ui): expose the attempt-log + PR-outcome stores via a read-only /attempts dashboard - #7718
Conversation
…-only /attempts dashboard The per-attempt event log (packages/loopover-miner/lib/attempt-log.ts) and the local PR-outcome records (pr-outcome.ts, reduced from the event ledger) are real, already-written data with no API exposure — run-history.tsx only shows current per-repo state, not a log of past attempts. Add a vite-attempt-log-api.ts plugin mirroring vite-ledgers-api.ts exactly (server-side aggregation to counts + a capped feed of SAFE columns; raw payload never crosses the wire; each store's DB path probed before read so a fresh install stays empty) and an /attempts route consuming it, showing per-attempt actionClass/provider/cost/tokens and PR outcomes. Closes JSONbored#7656
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-21 11:00:44 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual previewClick any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|



Summary
packages/loopover-miner/lib/attempt-log.ts(per-attempt event log: attemptId, actionClass, provider, costUsd, tokensUsed) andpr-outcome.ts(merged/closed records with rejection reason) hold real, already-written data with no API exposure —run-history.tsxonly shows current per-repo run state, not a log of past attempts (#7656).This adds a read-only API + dashboard view exposing both, extending the existing local-store-API pattern exactly:
vite-attempt-log-api.ts— mirrorsvite-ledgers-api.ts(types →emptyAttemptLogSummary()→ puresummarize*()helpers → injectableAttemptLogApiDeps→handleAttemptLogRequest→attemptLogApiPlugin).GET /api/attempt-logaggregates both stores server-side to counts + a capped feed of SAFE columns. The attempt log's free-formpayloadnever crosses the wire — only fixed columns are projected — the same invariant the sibling ledgers endpoint enforces. Each store's DB path is probed before reading, so a fresh install returns empty without creating the SQLite file; fail-softtry/catch→ 500. PR-outcomes are read viareadPrOutcomesover a reader built from the event ledger'sreadEvents./attemptsroute (attempts.tsx, mirroringledgers.tsx) — per-attempt history: totals, action-class / event-type breakdowns, a recent-attempts feed (action, provider, cost, tokens), and the miner's own PR outcomes (merged/closed + close-reason). Distinct fromrun-history.tsx's current-state view. Nav entry added after Ledgers.Entirely within
apps/loopover-miner-ui/**; reads the existing miner-lib exports without modifying them.Tests
New
attempt-log-api.test.ts(handler: populated / fresh-install-no-DB / non-matching-url / 500, plus a raw-payload-leak canary) andattempts.test.tsx(route: render / empty / error / loading / pagination / live-refresh), mirroring the sibling*-api.test.tsconventions. Full miner-ui suite: 368 pass.UI Evidence
The
/attemptsview rendered withVITE_DEMO_MODEsample data (DEMO_ATTEMPT_LOG_SUMMARY), dark theme (loopover-miner-ui defaults to dark).Validation
@loopover/ui-minertypecheck, lint (0 errors), test (368 pass incl. the 2 new suites), build, prettier — all green; rebased onto latestmain. Nosrc/**/packages/**changes (miner-ui is outside Codecov's include set).Closes #7656