Skip to content

feat(upload): add agent, skill and file-extension breakdowns to session stats - #374

Merged
quickbeard merged 1 commit into
mainfrom
feat/session-stats-breakdowns
Sep 25, 2026
Merged

quickbeard merged 1 commit into
mainfrom
feat/session-stats-breakdowns

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Summary

Follow-up to #373. The analysis web app is switching its reports from log-derived analytics to the session stats pushed at launch (oadtq/z8l-ai-hub#9, plus the reports PR). Four report breakdowns relied on fields the stats didn't carry, so each SessionStats record now includes them as optional { name: count } maps:

Field Contents Reports that use it
agents Assistant messages per agent (build, plan, …), top-level session only AI usage "by mode"
skills Skill uses by name: skill tool calls, plus reads of <name>/SKILL.md Top skills, proficiency skill diversity
skills_created Skills whose SKILL.md the session wrote (completed writes only) "Skills created"
file_extensions Distinct files read or modified, by lowercased extension File-type chart, proficiency language breadth
  • These match what ai-hub-worker's skills / file_paths / model_mode enrichers derived from markdown.
  • Subagent sessions count toward skills and files but not toward agents, since a subagent's turns aren't the session's mode.
  • The maps are additive to payload v1. The backend validator treats them as optional, so this doesn't need to ship in lockstep with it.
  • No DIVERGENCES.md row: packages/codev-upload is fork-only. No CHANGELOG entry, matching feat(upload): push session usage metrics at launch; logs upload only via codev upload --logs #373.

Test plan

  • bun test in packages/codev-upload (58 tests, including a new one covering all four maps: subagent handling, denied writes, case-folded and extensionless files)
  • bun typecheck in packages/codev-upload
  • End-to-end against a local Supabase running the ai-hub-web reports branch: 52 real sessions re-pushed with the maps filled in (agents on all 52, file extensions on 24, skills on 2), and the rebuilt codev_sessions view exposes them as mode, skills_invoked, file_extensions

🤖 Generated with Claude Code

…on stats

Session stats now carry four optional per-session maps the analysis
reports group by, matching what the worker used to derive from uploaded
markdown:

- agents: assistant messages per agent (build, plan, ...) in the
  top-level session
- skills: skill uses by name (skill tool calls and SKILL.md reads)
- skills_created: skills whose SKILL.md the session wrote
- file_extensions: distinct files read or modified, by extension

Subagent sessions contribute to skills and files, not to agents. The
fields are additive to payload v1; backends that predate them ignore
them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 8a927b4 into main Sep 25, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the feat/session-stats-breakdowns branch September 25, 2026 05:22
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.

1 participant