Skip to content

fix(digest): drop per-user rankings and lock English output with an e2e test - #7

Closed
hsuchifeng wants to merge 1 commit into
mainfrom
claude/jeffr2026-issues-4er10q-digest
Closed

hsuchifeng wants to merge 1 commit into
mainfrom
claude/jeffr2026-issues-4er10q-digest

Conversation

@hsuchifeng

Copy link
Copy Markdown
Owner

Summary

Follow-up to #3 (digest output in English, no per-user intervention / token rankings). The printed digest on main is already English and no longer prints the ranking lines, but summarizeInterventions / summarizeConversation still computed and returned per-user ranked arrays that nothing used. This PR:

  • removes the dead ranked fields so individual rankings cannot quietly come back through the summary API;
  • adds a real-CLI e2e test (src/__tests__/digest-output-e2e.test.ts): a git provider team with two members' reported stats on teamai-reports, then teamai digest must contain no CJK characters, print the English autonomy / token sections with team-wide totals, and never print a member name or the word "rank";
  • updates docs/usage-guide.md / docs/usage-guide.zh-CN.md, which still described per-person rankings.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature causing existing behavior to change)
  • Documentation only
  • Refactor / internal cleanup

Test Plan

  • npx tsc --noEmit passes
  • npm run lint passes
  • npx vitest run passes (full unit suite)
  • Real CLI e2e: npm run build && npx vitest run --config vitest.e2e.config.ts src/__tests__/digest-output-e2e.test.ts src/__tests__/intervention-e2e.test.ts src/__tests__/conversation-token-e2e.test.ts → 7/7 passed. Sample output from the run:
🤖 Session Autonomy (Human Intervention):
  Team avg: 1.43 interventions/session (14 sessions, 20 interventions)
  Breakdown: interrupt 14 · reject 2 · correction 4

💬 Lifetime Conversation & Token Usage:
  Lifetime human prompts: 130
  Lifetime tokens: 12.0K (input 6.0K · output 6.0K · cache read 0 · cache write 0)
  • Added/updated tests: new digest-output-e2e.test.ts; digest-interventions, conversation-token-metrics, conversation-token-e2e, intervention-e2e no longer assert on ranked

Related Issues

Covers the scenario from #3.

Notes for Reviewers

ranked was only read by tests; the summary interfaces lose that field. The teamai.yaml wording in skill-data/ does not mention rankings, so only the usage guides needed a docs update.


Generated by Claude Code

…2e test

The digest prints team-wide totals only; the unused per-user `ranked`
arrays in summarizeInterventions / summarizeConversation are removed so no
caller can bring individual rankings back. A real-CLI e2e test asserts the
digest is all English and names no member; usage-guide docs updated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5AmspzzVhLVupACwm4W3e
@hsuchifeng hsuchifeng self-assigned this Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Code Erosion Report

Informational — never blocks the merge. scb-check==0.2.0 SlopCodeBench metrics; method & caveats in docs/ci-code-erosion.md.

Metric Value Human band Agent band Reading
Verbosity* 0.073 0.15 0.33 human
Erosion 0.685 0.31 0.68 agent
Cognitive erosion 0.867 – – –

Scanned 304 files / 60608 SLOC · high-CC functions 420/4834

* On TypeScript, verbosity is partial and the bands are Python-calibrated.

Rule hits (TS verbosity layer)

Standalone ast-grep, separate from the number above.

Rule Hits
unnecessary-else-after-return 32
empty-catch-block 5
redundant-ternary-same 1

38 distinct lines flagged across src/.

@hsuchifeng hsuchifeng closed this Oct 9, 2026
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