Skip to content

cc-stats: count legacy stages correctly and render breakdowns as tables - #47

Merged
datacas merged 1 commit into
mainfrom
issue-42-cc-stats-followup
Sep 23, 2026
Merged

datacas merged 1 commit into
mainfrom
issue-42-cc-stats-followup

Conversation

@datacas

@datacas datacas commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #46, resolving the two remaining points from its rereview.

  • Legacy stage counting (REV-004). Rows recorded before schema 3 carry no record_kind, but verdicts and the closing row were already separate rows. stats.py now counts such a row as a stage only when it carries dispatch evidence (outcome, executor or profile). A schema-2 cycle (implement + review + verdict + close) now reports 2 stages instead of 4; duration and cost use the same rule.
  • Presentation. The Markdown report no longer embeds inline JSON. Roles, review verdicts, findings by severity (unreported severities show as unknown), dispatch blockages, Jev shadow status, agreement, confidence buckets, first-pass by suggested profile and the period comparison render as tables with exact counts beside proportional bars.
  • CHANGELOG.md entry for cc-stats updated.

Work item: #42 (kept open until the end-to-end checks from an agent host are done).

Verification

  • python3 scripts/validate-package.py — passed
  • python3 -m unittest discover -s tests — 590 tests passed, including two new ones: legacy rows count only dispatches as stages; Markdown renders breakdowns as tables with no inline JSON
  • git diff --check — passed

…tables

Rows recorded before schema 3 carry no record_kind, yet verdicts and the
closing row were already separate rows then. Count such a row as a stage only
when it carries dispatch evidence (outcome, executor or profile), so historical
verdicts and closes no longer inflate stages, roles, activity, duration or cost.

Render roles, verdicts, findings by severity, dispatch blockages and the Jev
comparison as Markdown tables with exact counts beside proportional bars
instead of inline JSON; unreported severities show as unknown.

Refs #42
@datacas

datacas commented Sep 23, 2026

Copy link
Copy Markdown
Owner Author

Initial review — PR #47 cc-stats: count legacy stages correctly and render breakdowns as tables

Verdict: APPROVED. Reviewed HEAD: 0d7c87cf5c536e16e97208e7f47f76949379c668.

Summary and scope

I reviewed the accumulated diff from merge-base ce3bb23e2c15ada7020b23711e824464639ba705 to the PR head. It changes scripts/stats.py, tests/test_stats.py, and CHANGELOG.md. The change matches the PR description and work item #42: it classifies pre-schema-3 rows using dispatch evidence, keeps current dispatch rows grouped by stage for stage-level totals, and renders the Markdown breakdowns as tables with exact counts and bars.

No actionable findings.

Security triage

Triage activated because the change affects telemetry reporting and observability. The scoped cc-security-review found no vulnerability in the changed code. Repository filtering remains parameterized, output remains aggregate, and the change adds no new request or authorization surface.

Verification

  • python3 -m unittest discover -s tests -p 'test_stats.py' -v — all 9 cc-stats tests passed.
  • python3 scripts/validate-package.py — passed: 13 skills validated and shared sections/manifests aligned.
  • python3 -m unittest discover -s tests -v — passed: 590 tests.
  • git diff --check origin/main...origin/issue-42-cc-stats-followup — passed with no output.

CI

All four GitHub check entries passed: both runs of PowerShell installer and both runs of Skills, manifests, and Bash installer.

Residual risk

The report was verified with generated rows in temporary SQLite databases; it was not run against a user's live telemetry database. The PR's unit tests cover legacy rows and Markdown rendering.

Project verdict

APPROVED — no open findings block approval.

@datacas
datacas merged commit 0a94152 into main Sep 23, 2026
4 checks passed
@datacas
datacas deleted the issue-42-cc-stats-followup branch September 24, 2026 09:21
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