Skip to content

feat(ui): trustworthy analytics with coverage — structured usage summary and /api/analytics (#200) - #229

Merged
DanielNetzer merged 1 commit into
mainfrom
forgecell/issue-200-ui-analytics
Oct 25, 2026
Merged

DanielNetzer merged 1 commit into
mainfrom
forgecell/issue-200-ui-analytics

Conversation

@DanielNetzer

Copy link
Copy Markdown
Owner

Closes #200.

Trustworthy analytics in forgecell ui:

  • Engine: molecule.UsageSummary(Record) is the structured data behind UsageSummaryLines, which stays the renderer. It records per-attempt cost, basis, tokens, effective models and coverage (n of m reported).
  • GET /api/analytics: outcome counts by lane; wall-clock, active Atom time and waiting time; a harness/model breakdown that keeps the Unknown and Not-recorded groups; cost with coverage.
    • Active time is the union of Atom intervals, never a sum across parallel Atoms.
    • Cost per merged PR is always Unavailable, because there's no verified merge attribution.
    • Unknown, Unavailable and missing usage are never shown as 0.
  • Rendered view: the no-selection overview in app.js renders it with text-only DOM nodes, and demo mode serves labelled sample data.
  • Guards: the same read guards as the other UI routes (cookie plus tab header, same-origin, GET only). The tests snapshot the Lab before and after to prove nothing is written.

Built by Forgecell Molecule mol-200-e4aa0dd6b2fa9dcc1d698058 (plan b3b2941f). Hand-delivered: the candidate failed one of its own new tests, but only under the Lab's long TMPDIR. Labels were truncated before redaction, so the lab path was cut mid-way and fell back to [local path] instead of <lab>. It didn't leak, but the order was wrong. Fixed here: redact first, then bound. I reproduced the failure with a long TMPDIR before the fix and confirmed it passes after.

Review: one independent adversarial pass. Fixed here: small reported costs rendered as $0.0000. They now use six decimals, like the engine's formatUSD. Rebased onto #201 (#227); the conflicts in server.go (the unavailable list) and app.js (the state object) were resolved as unions, and node --check passes. A clean-shell go test -timeout 25m ./..., vet and gofmt pass on the rebased commit.

LOWs (not fixed):

🤖 Generated with Claude Code

…ary and /api/analytics (#200)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DanielNetzer
DanielNetzer merged commit 950c19a into main Oct 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI-3: Lab UI — trustworthy analytics with coverage (structured usage summary)

1 participant