Skip to content

fix: scorecard event type mismatch with session-parser#284

Open
TerminalGravity wants to merge 2 commits intomainfrom
fix/scorecard-event-type-mismatch
Open

fix: scorecard event type mismatch with session-parser#284
TerminalGravity wants to merge 2 commits intomainfrom
fix/scorecard-event-type-mismatch

Conversation

@TerminalGravity
Copy link
Collaborator

Problem

generate_scorecard filtered events using user_prompt and assistant_response, but the session-parser actually emits prompt and assistant. This meant every scorecard had empty user/assistant message arrays, causing most scoring categories to return default/misleading scores.

Fix

Updated all event type filters in generate-scorecard.ts to accept both naming conventions (prompt/user_prompt, assistant/assistant_response, git_commit/commit).

Test

Added tests/lib/scorecard-classify.test.ts — regression test for event type matching. All 47 tests pass.

Adds a ready-to-use CLAUDE.md template that makes Claude Code
automatically run preflight_check on prompts. Users can copy it
into their project to get preflight working without manual tool calls.

Referenced from Quick Start in README and examples/README.
The session-parser emits events with type 'prompt' and 'assistant',
but generate_scorecard filtered on 'user_prompt' and 'assistant_response'.
This caused all user/assistant message arrays to be empty, making
scorecard categories return default/misleading scores.

Fix all event type filters to accept both naming conventions.
Add regression test for event type matching.
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