Skip to content

feat(analyze): corpus-wide agent-usage report #2437

Closed

Description

@Sinity

Outcome

polylogue analyze --portfolio renders one report over the whole archive (or a
--since/--origin-bounded slice): aggregate session/repo/origin counts, cost and wall-clock
distributions, the top recurring failure-mode pathologies, and the top context-loss patterns.
It is the corpus-scope sibling of the per-session postmortem bundle (#2380).

Shipped shape

polylogue/insights/portfolio.py — a pure aggregator (compile_portfolio_bundle) composing
the postmortem metric vocabulary (#2380) and the pathology distribution (#2383) over a
whole-archive scope, adding per-session cost and wall-clock DistributionStat (nearest-rank
quartiles, deterministic), per-origin counts, and the context-loss (stale-context)
distribution. No-signal fields degrade honestly. Plain/markdown/JSON renderers; surfaced via
Polylogue.portfolio_bundle(spec) and the analyze --portfolio CLI verb.

Relationship

Parent #1807 (analysis). Composes #2316 (cost/wallclock) and #2383 (pathologies); corpus-scope
sibling of #2380. Adds no new durable schema noun — a projection/Bundle.

Activity

  1. added
    type:feat
    area:insights
    theme:analysis
    theme:ux
    on Jun 26, 2026
  2. Sinity commented on Jun 26, 2026

    @Sinity
    OwnerAuthor

    Realized in #2451 (merged to master).

    analyze --portfolio renders the corpus-wide sanitized report (plain/markdown/json):

    • ✅ One documented command over the whole archive: session/repo/origin counts, cost + wall-clock distributions, top failure-mode pathologies, top context-loss patterns.
    • ✅ Routed through the #2381 sanitizer (sanitize_rows) and fail-closed via assert_text_sanitized — sanitizer failure ⇒ no raw leak (the gate also withholds leaked values from its own error message, CodeRabbit-hardened).
    • ✅ No-signal fields degrade honestly (empty distributions, PathologyField unavailable/clean).
    • ✅ Composes feat(usage): make provider token accounting complete and auditable #2316 (cost/wallclock) and feat(insights): mine agent-workflow failure-mode pathologies #2383 (pathologies); degrades when absent; no new durable schema noun (a projection/Bundle).
    • ✅ Deterministic snapshot-tested (plain/json/markdown) in the plain-CLI lane.

    Closing as fully realized.

  3. changed the title [-]feat(analyze): corpus-wide sanitized agent-usage portfolio report[/-] [+]feat(analyze): corpus-wide agent-usage report[/+] on Jun 27, 2026
  4. added a commit that references this issue on Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:insightstheme:analysistheme:uxtype:feat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions