Commit d6ed5e0
feat(admin): add growth-report — cross-platform use-case growth & rates (HTML) (#25)
* feat(admin): add growth-report action skeleton (cross-platform growth HTML)
* feat(admin): core creation-event, usage-metric, and window models for growth-report
* refactor(admin): relocate time-bucket helpers to utils; add growth rate layer
* feat(admin): EM collector — project use cases (proxied creation) + experiment/registry usage metrics
* fix(admin): fetch EM experiments once per project (avoid duplicate API calls)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(admin): Opik collector — project use cases + span-count usage metrics
* feat(admin): MPM collector — monitored-model use cases (probe/proxy) + prediction-volume usage
* fix(admin): guard MPM enumeration against malformed workspace/model elements
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(admin): unified use-case/department roll-up + usage grouping + workspace proxy
* feat(admin): self-contained HTML growth dashboard renderer
* test(admin): make growth-report secret-leak test meaningful; drop unused imports/noqa
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(admin): growth-report orchestrator + workspace resolution + docs
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(admin): drop unused growth-report helpers; add end-to-end render test; polish
Removes bucket_events/workspace_creation_events/usage_by_workspace (verified
unused by the pipeline), fixes _open() to resolve relative --output paths,
drops a dead noqa line, and adds a full-chain generate_growth_report ->
build() -> build_html() integration test.
* fix(admin): filter EM projects to the requested workspace
The Comet EM projects endpoint returns a fallback set from another
workspace (ignoring workspaceName) when the API key isn't a member of
the requested workspace. That caused those foreign projects to be
mis-attributed to every inaccessible workspace, showing as duplicate
project names in the EM adoption table and inflating EM growth counts.
Keep only projects whose own workspaceName matches the requested one;
warn when projects are dropped, and still report the workspace at 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(admin): make growth-report tables collapsible (collapsed by default)
Wrap every report table in a native <details>/<summary> disclosure (no
JS, stays self-contained). Tables start collapsed with the title + row
count in the summary, so large tables don't dominate the page as data
grows. Also give the per-product growth breakdown tables real titles so
their summaries read meaningfully instead of a generic label.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(admin): growth-report render improvements
- Rename 'Departments' -> 'Workspaces' everywhere, with a 'proxy for
teams / departments' clarification (label was misleading; these are
workspaces used as a department/group proxy).
- Cumulative (area) charts: add per-point hover tooltips, x-axis time
labels on both edges (+ intervals), a max-value gridline label, and
the final cumulative value — previously they showed no numbers.
- Adoption/usage sections: add usage growth KPIs (New / Growth% over the
window) and a fastest-growing-project KPI, not just the total.
- Adoption/usage sections: add a cumulative area chart alongside the
per-period bars.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(admin): real chart hover tooltips; cumulative edge-only dates; always show fastest-growing project
1. Replace flaky native SVG <title> tooltips with a real interactive
tooltip (positioned div + vertical guide line) driven by per-column
hit rects; shared across bar, area, and stacked charts.
2. Cumulative (area) charts now label only the earliest and latest dates
on the x-axis (instead of every interval), per request.
3. Always surface the fastest-growing-project KPI for every product
(incl. EM = most new experiments in the analysis window), showing
'—' when nothing grew in-window so it never appears missing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(admin): skip optional-extra tests when opik/comet_mpm absent (fix CI)
CI installs only requirements.txt (opik present, comet_mpm not), but the
growth-report tests patched comet_mpm/opik unconditionally, erroring at
setup with ModuleNotFoundError. Guard the SDK-patching tests with
skipif(find_spec(...) is None), and make the two cross-platform assembly
tests env-independent by forcing the resolved platform set instead of
relying on which optional extras happen to be installed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(admin): coerce datapoint values to float before count aggregation
Non-numeric or mixed-type value/y from Opik SPAN_COUNT and MPM prediction
responses could raise TypeError on `counts[...] += ...` and abort collection.
Add _as_float() to coerce datapoints (None/blank/non-numeric -> 0.0).
Addresses baz-reviewer Type Inconsistency findings.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor(admin): extract shared workspace-summary UsageMetric helper
EM/Opik/MPM collectors each appended a near-identical workspace-level
(project=None) UsageMetric block, so the summary shape could drift.
Route all three through _workspace_usage_metric().
Addresses baz-reviewer Code Dedup finding.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(admin): derive EM experiment KPI total from bucketed counts, not metadata
The EM EXPERIMENT_COUNT total (and its workspace roll-up) was sourced from
`numberOfExperiments` metadata while the chart series was built from
experiments bucketed by start_server_timestamp. When those disagree, the
adoption KPI total didn't equal the cumulative chart sum. Derive `total`
from the same counts map that feeds the series so they always match.
Add a regression test covering the metadata-disagrees case.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Douglas Blank <doug@comet.com>1 parent 647b1b4 commit d6ed5e0
8 files changed
Lines changed: 4026 additions & 127 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
581 | 630 | | |
582 | 631 | | |
583 | 632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
464 | 538 | | |
465 | 539 | | |
466 | 540 | | |
| |||
746 | 820 | | |
747 | 821 | | |
748 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
749 | 842 | | |
750 | 843 | | |
751 | 844 | | |
| |||
0 commit comments